Running "db.$cmd.sys.unlock.findOne();" from a .js file

100 views
Skip to first unread message

LindsayBlanton

unread,
Aug 5, 2010, 5:58:49 PM8/5/10
to mongodb-user
Does anyone know how I can run the fsyc unlock command from a .js
file?

When I run the following .js file I don't get the expected result and
no error message.


--- unlockMongoDb.js ---

db = db.getSisterDB( "admin" );
db.$cmd.sys.unlock.findOne();

---

I've tried escaping the $cmd portion of the command thinking there is
a problem there however I then get an error message back from the
Mongo shell.

Any ideas? I'm trying to implemement backups using shell scripts and
the mongo shell, and I can fsync and lock the database just fine via
a .js file but unable to implement the unlock.

Thanks in advance.

Warm regards,

Lindsay Blanton
RadioReference.com LLC

Lindsay C. Blanton III

unread,
Aug 5, 2010, 6:14:17 PM8/5/10
to mongodb-user
I've find out that the following does the trick:

db.getSisterDB( 'admin' ).getCollection( "$cmd.sys.unlock" ).findOne();

Hope this is helpful!

Warm regards,

Lindsay
Reply all
Reply to author
Forward
0 new messages