Python bson.max_key() Examples
The following are 2
code examples of bson.max_key().
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_maxkey(doc): """Decode a JSON MaxKey to bson.max_key.MaxKey.""" if doc['$maxKey'] is not 1: raise TypeError('$maxKey value must be 1: %s', (doc,)) if len(doc) != 1: raise TypeError('Bad $minKey, extra field(s): %s' % (doc,)) return MaxKey()
Example #2
Source File: json_util.py From learn_python3_spider with MIT License | 5 votes |
def _parse_canonical_maxkey(doc): """Decode a JSON MaxKey to bson.max_key.MaxKey.""" if doc['$maxKey'] is not 1: raise TypeError('$maxKey value must be 1: %s', (doc,)) if len(doc) != 1: raise TypeError('Bad $minKey, extra field(s): %s' % (doc,)) return MaxKey()