Go to file
Sascha Matzke 56bad90e73 fixed collection problem (query) 2009-04-24 09:32:00 +02:00
bson made auto node discovery work 2009-04-22 16:09:03 +02:00
mongodb fixed collection problem (query) 2009-04-24 09:32:00 +02:00
.gitignore changed find, update and get-more 2009-03-11 14:40:07 +01:00
README.txt added a short example to README.txt 2009-03-04 06:59:40 +01:00

README.txt

This is the attempt to implement a driver for MongoDB
(http://www.mongodb.org) in Factor (http://www.factorcode.org).

Usage example (for a quick overview):

USE: mongodb.driver

! 1. initialize mdb
! database host port <mdb>
"db" "127.0.0.1" 27017 <mdb>

! 2. create an index
! <mdb> [ collection name spec ensure-index ] with-db
dup [ "test" "idIdx" H{ { "_id" 1 } } ensure-index ] with-db

! 3. insert an object
! <mdb> [ collection object save ] with-db
dup [ "test" H{ { "_id" "12345" } { "name" "myobject" } } save ] with-db

! 4. find the object
! <mdb> [ collection example <query> ..options.. find ] with-db
dup [ "test" H{ { "_id" "12345" } } <query> find ] with-db

! a find with options would look like this

dup [ "test" H{ { "name" "myobject" } } <query> 10 limit 
      [ "_id" asc "name" desc ] sort find ] with-db