1
/** @page tut_mongo_sync_query_complex Querying documents, part two
3
* We learned how to make simple queries in the previous section,
4
* we'll be brave and do something much more advanced this time: we'll
5
* limit the query to documents that have their @c "yes?" field set to
6
* @a FALSE, and sort the results by the @c "n" field, in ascending
9
* @dontinclude tut_mongo_sync.c
10
* @skip tut_sync_query_simple
19
* After our routine connect, we build the query and select BSON
22
* @until bson_finish (select)
24
* Then we launch the query:
25
* @until bson_free (select)
27
* And make a cursor, just like last time:
30
* And that's pretty much the bulk of what we wanted to do: we just
31
* constructed our query and select BSON objects appropriately, and
32
* mongo_sync_cmd_query() does the rest.
34
* But just to make sure our results are sane, we iterate over the
35
* returned documents, and print the fields we're interested in:
40
* And when that is done, all that is left, is to clean up after