简体   繁体   中英

How to debug MongoDB JavaScript with V8 debugger

MongoDB since 2.4 has V8 as its JavaScript engine. As Nodeclipse contributor I wonder could it be possible to use the same V8 remote debugger to debug (with break-points, variable inspections etc) JavaScript running on Mongo instance.

Code example

rsconfig = rs.config()
printjson(rsconfig)
rsconfig.members[0].priority = 10
rs.reconfig(rsconfig)

So instead of printjson it would be better to have take a look into variables values, to get better insight of MongoDB

I started my search with Stackoverflow. MongoDB site has just a few pages at http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/

Older questions (not V8 aware)

From Google group Can I debug a mongo script? -> answer is just No

May not be exact answer for this question, but if somebody wants to write script and test it , just for manipulating mongo data. You can always use nodejs with mongodb connector. And debug your js code using node-debugger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM