1,How can i get the return value of my operations in monogd, by python ?i know getLastError can be used in javascript.
2,is there limit to set modifer?
if i use
collection.update({"notification":"yes"},{"$set":{ "idx":idx,"src_md5":src_md5,"src_size":src_size,"src_time":int(src_time)},"$addToSet":
{"server_list":host_name}})
it didn't work.
but when i use
collection.update({"notification":"yes"},{"$set":
{"idx":idx,"src_md5":src_md5,"src_size":src_size},"$set":
{"src_time":int(src_time)},"$addToSet":{"server_list":host_name}})
it worked.
why?
1) You can use write concern keyword arguments, to ensure that
getLastError
is called. The various methods are described below:You can set these write concerns at different levels depending on your needs:
2) Your query looks fine heres a test: