the data structure to query for such as the following:
take the Versionlimitlist field in the query as an example
Mongooperations Tool class Query related statements
<pre name= "code" class= "java" >criteria criteria1 = Criteria.where ("Validstarttime"). GT (New Date ()). and (" Versionlimitlist "). Elemmatch (Criteria.where (" ClientId "). Is (109), and (" Platformcode "). is (2);
the query validstarttime is greater than the current time, and the clientId in the Versionlimitlist field The property value is 109 and the Platformcode property value is 2
statements in the Mongovue
{" validstarttime": { "$gt": Isodate ("2014-11-01t10:33:09.661z") }, "Versionlimitlist": { "$ Elemmatch ": { " clientId ": 109, " Platformcode ": 2}} }
The corresponding actual running statement
Db.systemInfo211.find ({"Validstarttime": {"$gt": Isodate ("2014-11-01t10:33:09.661z")}, "Versionlimitlist": {"$elem Match ": {" clientId ": 109," Platformcode ": 2}}). Limit (50);
Query results such as the following
A query in MongoDB that includes a field in a collection in a query condition