~ubuntu-branches/ubuntu/saucy/syslog-ng/saucy

« back to all changes in this revision

Viewing changes to modules/afmongodb/libmongo-client/docs/tutorial/tut_mongo_sync_query_complex.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2011-11-15 08:48:02 UTC
  • mfrom: (26.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111115084802-n0jegdnjlxk0m26s
Tags: 3.3.1.dfsg-1ubuntu1
* debian/control: remove libsystemd-daemon-dev build-depends
* debian/rules: remove --with-systemdsystemunitdir from
  override_dh_auto_configure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @page tut_mongo_sync_query_complex Querying documents, part two
 
2
 *
 
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
 
7
 * order.
 
8
 *
 
9
 * @dontinclude tut_mongo_sync.c
 
10
 * @skip tut_sync_query_simple
 
11
 * @skip }
 
12
 * @skip void
 
13
 * @until {
 
14
 *
 
15
 * @until gint i
 
16
 *
 
17
 * @until }
 
18
 *
 
19
 * After our routine connect, we build the query and select BSON
 
20
 * objects:
 
21
 *
 
22
 * @until bson_finish (select)
 
23
 *
 
24
 * Then we launch the query:
 
25
 * @until bson_free (select)
 
26
 *
 
27
 * And make a cursor, just like last time:
 
28
 * @until }
 
29
 *
 
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.
 
33
 *
 
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:
 
36
 *
 
37
 * @until i++
 
38
 * @until }
 
39
 *
 
40
 * And when that is done, all that is left, is to clean up after
 
41
 * ourselves:
 
42
 * @until }
 
43
 */