2 BSON
(require (planet jaymccarthy/mongodb:1:=12/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.
(struct bson-timestamp (value) #:extra-constructor-name make-bson-timestamp) 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.
(struct bson-javascript/scope (string scope) #:extra-constructor-name make-bson-javascript/scope) string : string? scope : bson-document/c
A value representing Javascript code and its scope.
(struct bson-binary (type bs) #:extra-constructor-name make-bson-binary) type : (symbols 'function 'binary 'uuid 'md5 'user-defined) bs : bytes?
A value representing binary data.
(struct bson-regexp (pattern options) #:extra-constructor-name make-bson-regexp) 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.