MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / to_json

Method to_json

mongoengine/queryset/base.py:1317–1329  ·  view source on GitHub ↗

Converts a queryset to JSON

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

1315 # JSON Helpers
1316
1317 def to_json(self, *args, **kwargs):
1318 """Converts a queryset to JSON"""
1319 if "json_options" not in kwargs:
1320 warnings.warn(
1321 "No 'json_options' are specified! Falling back to "
1322 "LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. "
1323 "For use with other MongoDB drivers specify the UUID "
1324 "representation to use. This will be changed to "
1325 "uuid_representation=UNSPECIFIED in a future release.",
1326 DeprecationWarning,
1327 )
1328 kwargs["json_options"] = LEGACY_JSON_OPTIONS
1329 return json_util.dumps(self.as_pymongo(), *args, **kwargs)
1330
1331 def from_json(self, json_data):
1332 """Converts json data to unsaved objects"""

Callers 14

test_modifyMethod · 0.45
test_modify_with_newMethod · 0.45
test_json_simpleMethod · 0.45
test_json_complexMethod · 0.45
test_modify_updateMethod · 0.45
test_json_namesMethod · 0.45
test_json_simpleMethod · 0.45
__eq__Method · 0.45

Calls 1

as_pymongoMethod · 0.95

Tested by 14

test_modifyMethod · 0.36
test_modify_with_newMethod · 0.36
test_json_simpleMethod · 0.36
test_json_complexMethod · 0.36
test_modify_updateMethod · 0.36
test_json_namesMethod · 0.36
test_json_simpleMethod · 0.36
__eq__Method · 0.36