[SERVER-3629] ensure that find readonly is implemented (SERVER-3107) Created: 17/Aug/11  Updated: 11/Jul/16  Resolved: 05/Oct/11

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Task Priority: Major - P3
Reporter: Aaron Staple Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-3107 For JS, add a findRO() that returns a... Closed
Participants:

 Description   

See QA-19

  • I haven't identified any code, tests, or docs for findRO(), find().readOnly(), etc - maybe I am not looking in the right places.
  • I'm not seeing where V8STR_RO is getting set for cursor objects. I was able to set it up manually using:
    cur = db.c.find();
    cur._exec();
    cur._cursor['_ro'] = true;
    but maybe the helper still needs to be implemented or I didn't see it.
  • I added some logging and I think I confirmed that once _ro was set, I could read a doc and write it using the original bson representation, as in the example for SERVER-3107.


 Comments   
Comment by Antoine Girbal [ 05/Oct/11 ]

odd, it looks like a git screwup.
I put the implementation back in.

> var doc = db.verbose.find().readOnly().next()
> doc.b = 3
cannot write property b to read-only object
3
> doc

{ "_id" : ObjectId("4e8bf1a8d2248dec7403532c"), "a" : 1 }
Comment by auto [ 05/Oct/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: - SERVER-1507: option as string must be converted to boolean

Generated at Thu Feb 08 03:03:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.