Created
May 11, 2017 03:40
-
-
Save anidotnet/ceca3efc429c1fdaa120a3d0dec8c4cf to your computer and use it in GitHub Desktop.
Nitrite Introduction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cursor cursor = collection.find( | |
// and clause | |
and( | |
// firstName == John | |
eq("firstName", "John"), | |
// elements of data array is less than 4 | |
elemMatch("data", lt("$", 4)), | |
// elements of fruits list has one element matching orange | |
elemMatch("fruits", regex("$", "orange")), | |
// note field contains string 'quick' using full-text index | |
text("note", "quick") | |
) | |
); | |
for (Document document : cursor) { | |
// process the document | |
} | |
// create document by id | |
Document document = collection.getById(nitriteId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment