mongodb - Locking Documents whose Geospatial Index is Located within a Bounding Box? -
i have collection of documents:
{ location: { lon: 3.14, lat: 2.72 }, value: 0.71 }
a geospatial index defined on content of location-key.
is possible lock bounding box regarding geospatial index?
that means no documents in bbox may added, removed or changed?
does mongodb provide means requirement?
no. there's no mechanism locking documents. have implement lock @ application level, adding locked : true
field documents in bounding box , requiring locked : false
in updates/removes , checking inserts don't fall within box. aware mongodb doesn't have transactions, if perform multi : true
update concurrently other operations, documents seen unlocked part of update have yet affected update.
Comments
Post a Comment