Add documentation of mongo query syntax usage

This commit is contained in:
Calen Pennington
2012-06-19 11:29:48 -04:00
parent 677c25ee68
commit 5562def5b7

View File

@@ -67,6 +67,9 @@ class MongoKeyStore(KeyStore):
location: Something that can be passed to Location location: Something that can be passed to Location
data: A nested dictionary of problem data data: A nested dictionary of problem data
""" """
# See http://www.mongodb.org/display/DOCS/Updating for
# atomic update syntax
self.collection.update( self.collection.update(
{'location': Location(location).dict()}, {'location': Location(location).dict()},
{'$set': {'data': data}} {'$set': {'data': data}}
@@ -80,6 +83,9 @@ class MongoKeyStore(KeyStore):
location: Something that can be passed to Location location: Something that can be passed to Location
children: A list of child item identifiers children: A list of child item identifiers
""" """
# See http://www.mongodb.org/display/DOCS/Updating for
# atomic update syntax
self.collection.update( self.collection.update(
{'location': Location(location).dict()}, {'location': Location(location).dict()},
{'$set': {'children': children}} {'$set': {'children': children}}