-USING: assocs help.markup help.syntax kernel quotations ;
+USING: help.markup help.syntax ;
IN: mongodb
ARTICLE: "mongodb" "MongoDB factor integration"
"USING: mongodb.driver ;"
"\"db\" \"127.0.0.1\" 27017 <mdb>"
"[ \"mycollection\" [ H{ { \"name\" \"Alfred\" } { \"age\" 57 } } save ] "
- " [ ageIdx [ \"age\" asc ] key-spec <index-spec> ensure-index ]"
+ " [ \"ageIdx\" [ \"age\" asc ] key-spec <index-spec> ensure-index ]"
" [ H{ { \"age\" H{ { \"$gt\" 50 } } } } <query> find-one ] tri ] with-db "
"" }
{ $heading "Highlevel tuple integration" }
"The " { $vocab-link "mongodb.tuple" } " vocabulary lets you define persistent tuples that can be stored to and retrieved from a MongoDB database"
{ $unchecked-example
- "USING: mongodb.driver mongodb.tuple fry ;"
+ "USING: mongodb.driver mongodb.tuple fry literals ;"
"MDBTUPLE: person name age ; "
- "person \"persons\" { { \"age\" +fieldindex+ } } define-persistent "
+ "person \"persons\" { } { $[ \"ageIdx\" [ \"age\" asc ] key-spec <tuple-index> ] } define-persistent "
"\"db\" \"127.0.0.1\" 27017 <mdb>"
"person new \"Alfred\" >>name 57 >>age"
- "'[ _ save-tuple person new 57 >>age select-tuple ] with-db"
+ "'[ person ensure-table _ save-tuple person new 57 >>age select-tuple ] with-db"
"" }
;
-ABOUT: "mongodb"
\ No newline at end of file
+ABOUT: "mongodb"