2 BSON
(require (planet jaymccarthy/mongodb:1:0/bson/main)) |
MongoDB depends on BSON. This module contains an encoding of BSON values as Scheme values.
A BSON document is a dictionary that maps symbols to BSON values.
A BSON sequence is sequence of BSON values.
A test for 32-bit integers.
A test for 64-bit integers.
bson-document/c : contract? |
A contract for BSON documents.
bson-sequence/c : contract? |
A contract for BSON sequences.
A few BSON types do not have equivalents in Scheme.
A test for bson-min-key.
The smallest BSON value.
A test for bson-max-key.
The largest BSON value.
A test for bson-null.
The missing BSON value.
| ||||||
value : int64? |
A value representing an internal MongoDB type.
A test for BSON ObjectIds, an internal MongoDB type.
Returns a fresh ObjectId.
(bson-objectid-timestamp oid) → exact-integer? |
oid : bson-objectid? |
Returns the part of the ObjectID conventionally representing a timestamp.
A few BSON types have equivalents in Scheme, but because of additional tagging of them in BSON, we have to create structures to preserve the tagging.
A value representing Javascript code.
| ||||||
string : string? | ||||||
scope : bson-document/c |
A value representing Javascript code and its scope.
| ||||||
type : (symbols 'function 'binary 'uuid 'md5 'user-defined) | ||||||
bs : bytes? |
A value representing binary data.
| ||||||
pattern : string? | ||||||
options : string? |
A value representing a regular expression.
2.1 Decoding Conventions
Only make-hasheq dictionaries are returned as BSON documents.
A bson-binary? where bson-binary-type is equal to 'binary is never returned. It is converted to bytes?.
Only vector sequences are returned as BSON sequences.