Permalink
Browse files

added >multi word, removed unused singletons, fixed tuple example in …

…docs
  • Loading branch information...
1 parent 7e14e33 commit b825c2f68c67fb6f0b59002e6564d4b77c712fee @x6j8x x6j8x committed Jul 31, 2010
@@ -5,6 +5,7 @@ mongodb.cmd mongodb.connection mongodb.msg namespaces parser
prettyprint prettyprint.custom prettyprint.sections sequences
sets splitting strings ;
FROM: ascii => ascii? ;
+FROM: math.bitwise => set-bit ;
IN: mongodb.driver
TUPLE: mdb-pool < pool mdb ;
@@ -278,7 +279,10 @@ PRIVATE>
[ check-collection ] 2dip <mdb-update-msg> ;
: >upsert ( mdb-update-msg -- mdb-update-msg )
- 1 >>upsert? ;
+ [ 0 set-bit ] change-update-flags ;
+
+: >multi ( mdb-update-msg -- mdb-update-msg )
+ [ 1 set-bit ] change-update-flags ;
: update ( mdb-update-msg -- )
send-message-check-error ;
@@ -20,7 +20,7 @@ ARTICLE: "mongodb" "MongoDB factor integration"
"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"
"" }
;
@@ -38,7 +38,7 @@ TUPLE: mdb-insert-msg < mdb-msg
TUPLE: mdb-update-msg < mdb-msg
{ collection string }
- { upsert? integer initial: 0 }
+ { update-flags integer initial: 0 }
{ selector assoc }
{ object assoc } ;
@@ -120,7 +120,7 @@ PRIVATE>
{
[ flags>> write-int32 ]
[ collection>> write-cstring ]
- [ upsert?>> write-int32 ]
+ [ update-flags>> write-int32 ]
[ selector>> assoc>stream ]
[ object>> assoc>stream ]
} cleave
@@ -7,8 +7,6 @@ FROM: mongodb.tuple.persistent => assoc>tuple ;
IN: mongodb.tuple
-SINGLETONS: +fieldindex+ +compoundindex+ +deepindex+ +unique+ ;
-
SYNTAX: MDBTUPLE:
parse-tuple-definition
mdb-check-slots

0 comments on commit b825c2f

Please sign in to comment.