Skip to content

Commit 471ee5f

Browse files
author
Christian Hergert
committed
docs: improve bcon example
1 parent ed403c0 commit 471ee5f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

TUTORIAL.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,15 @@ main (int argc,
321321
{
322322
bson_t *doc;
323323
324-
doc = BCON_NEW ("$set", "{",
325-
"name", BCON_UTF8 ("bambino"),
326-
"$push", "{",
327-
"wins", BCON_INT32 (1),
328-
"}",
329-
"}");
324+
doc = BCON_NEW ("name", BCON_UTF8 ("Babe Ruth"),
325+
"batting_average", BCON_DOUBLE (.342),
326+
"hits", BCON_INT32 (2873),
327+
"home_runs", BCON_INT32 (714),
328+
"rbi", BCON_INT32 (2213),
329+
"nicknames", "[",
330+
BCON_UTF8 ("the Sultan of Swat"),
331+
BCON_UTF8 ("the Bambino"),
332+
"]");
330333
331334
str = bson_as_json (doc, NULL);
332335
printf ("%s\n", str);

0 commit comments

Comments
 (0)