-
Notifications
You must be signed in to change notification settings - Fork 1
Query API
donnyv edited this page Sep 1, 2013
·
9 revisions
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"}));
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"));
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));
Matches values that are greater than or equal to the value specified in the query.
var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.GTE("Age", 25));
An array of possible values can be supplied, a collection will be returned if any of the supplied values is matched
var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.In("FirstName", new []{"tom", "jim", "donny"}));
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.LT("Age", 25));
Matches values that are less than or equal to the value specified in the query.
var db = new enosql.EnosqlDatabase(@"c:\temp\db.jdb");
var PeopleCollection = db.GetCollection<People>();
PeopleCollection.Find(EnosqlQuery.LTE("Age", 25));
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")
);