forked from factor/factor
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added small introduction article for mongodb
added mongodb root vocab
- Loading branch information
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
USING: assocs help.markup help.syntax kernel quotations ; | ||
IN: mongodb | ||
|
||
ARTICLE: "mongodb" "MongoDB factor integration" | ||
"The " { $vocab-link "mongodb" } " vocabulary provides two different interfaces to the MongoDB document-oriented database" | ||
{ $heading "Low-level driver" } | ||
"The " { $vocab-link "mongodb.driver" } " vocabulary provides a low-level interface to MongoDB." | ||
{ $unchecked-example | ||
"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 ]" | ||
" [ 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 ;" | ||
"MDBTUPLE: person name age ; " | ||
"person \"persons\" { { \"age\" +fieldindex+ } } 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" | ||
"" } | ||
; | ||
|
||
ABOUT: "mongodb" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
USING: vocabs.loader ; | ||
|
||
IN: mongodb | ||
|
||
"mongodb.connection" require | ||
"mongodb.driver" require | ||
"mongodb.tuple" require | ||
|