USING: accessors arrays assocs bson.constants classes classes.tuple
combinators continuations fry kernel mongodb.driver sequences strings
-vectors words ;
+vectors words combinators.smart ;
IN: mongodb.tuple
PRIVATE>
: MDB_ADDON_SLOTS ( -- slots )
- { } [ MDB_OID_FIELD MDB_META_FIELD ] with-datastack ; inline
+ [ MDB_OID_FIELD MDB_META_FIELD ] output>array ; inline
: link-class ( collection class -- )
over classes>>
CONSTRUCTOR: cond-value ( value quot -- cond-value ) ;
: write-mdb-persistent ( value quot: ( tuple -- assoc ) -- value' )
- over needs-store?
- [ over [ (( tuple -- assoc )) call-effect ] dip
- [ tuple-collection name>> ] keep
- [ add-storable ] dip
- ] [ drop ] if
- [ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
+ over needs-store? mdb-dirty-handling? get and
+ [ over [ (( tuple -- assoc )) call-effect ] dip
+ [ tuple-collection name>> ] keep
+ [ add-storable ] dip
+ ] [ drop ] if
+ [ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
: write-field ( value quot: ( tuple -- assoc ) -- value' )
<cond-value> {