Python bson.objectid() Examples
The following are 2
code examples of bson.objectid().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
bson
, or try the search function
.
Example #1
Source File: json_util.py From vnpy_crypto with MIT License | 5 votes |
def _parse_canonical_oid(doc): """Decode a JSON ObjectId to bson.objectid.ObjectId.""" if len(doc) != 1: raise TypeError('Bad $oid, extra field(s): %s' % (doc,)) return ObjectId(doc['$oid'])
Example #2
Source File: json_util.py From learn_python3_spider with MIT License | 5 votes |
def _parse_canonical_oid(doc): """Decode a JSON ObjectId to bson.objectid.ObjectId.""" if len(doc) != 1: raise TypeError('Bad $oid, extra field(s): %s' % (doc,)) return ObjectId(doc['$oid'])