]> gitweb.factorcode.org Git - factor.git/blob - extra/bson/constants/constants.factor
Merge commit 'mongo-factor-driver/master' into mongo-factor-driver
[factor.git] / extra / bson / constants / constants.factor
1 USING: accessors constructors kernel strings uuid ;
2
3 IN: bson.constants
4
5 : <objid> ( -- objid )
6    uuid1 ; inline
7
8 TUPLE: oid { a initial: 0 } { b initial: 0 } ;
9
10 TUPLE: objref ns objid ;
11
12 CONSTRUCTOR: objref ( ns objid -- objref ) ;
13
14 TUPLE: mdbregexp { regexp string } { options string } ;
15
16 : <mdbregexp> ( string -- mdbregexp )
17    [ mdbregexp new ] dip >>regexp ;
18
19
20 CONSTANT: MDB_OID_FIELD "_id"
21 CONSTANT: MDB_META_FIELD "_mfd"
22
23 CONSTANT: T_EOO  0  
24 CONSTANT: T_Double  1  
25 CONSTANT: T_Integer  16  
26 CONSTANT: T_Boolean  8  
27 CONSTANT: T_String  2  
28 CONSTANT: T_Object  3  
29 CONSTANT: T_Array  4  
30 CONSTANT: T_Binary  5  
31 CONSTANT: T_Undefined  6  
32 CONSTANT: T_OID  7  
33 CONSTANT: T_Date  9  
34 CONSTANT: T_NULL  10  
35 CONSTANT: T_Regexp  11  
36 CONSTANT: T_DBRef  12  
37 CONSTANT: T_Code  13  
38 CONSTANT: T_ScopedCode  17  
39 CONSTANT: T_Symbol  14  
40 CONSTANT: T_JSTypeMax  16  
41 CONSTANT: T_MaxKey  127  
42
43 CONSTANT: T_Binary_Function 1   
44 CONSTANT: T_Binary_Bytes 2
45 CONSTANT: T_Binary_UUID 3
46 CONSTANT: T_Binary_MD5 5
47 CONSTANT: T_Binary_Custom 128
48
49