Go to file
Sascha Matzke fbae728a2e added support (write/read) for timestamps 2009-03-06 14:37:11 +01:00
bson added support (write/read) for timestamps 2009-03-06 14:37:11 +01:00
mongodb fixed bug in bson.writer which caused any field name "_id" to be written twice, 2009-03-05 07:01:12 +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