Skip to content
donnyv edited this page Sep 1, 2013 · 9 revisions

Comparison

All

Assumes the object property is an array and only returns collections where all supplied values are matched.

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.All("FirstName", new []{"tom", "jim", "donny"}));

Contains

Assumes that the object property is an array and searches for the query value in the array.

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>()

EQ

Performs a strict equality test using ===.

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.EQ("FirstName", "Donny"));

GT

Matches values that are greater than the value specified in the query.

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.GT("Age", 25));

LT

Matches values that are less than the value specified in the query.

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.GT("Age", 25));

Logical

And

Joins query clauses with a logical AND returns all documents that match the conditions of both clauses

var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.And(
  EnosqlQuery.EQ("FirstName", "Donny"),
  EnosqlQuery.LikeI("LastName", "smi")
);
Clone this wiki locally