简化在Mongo shell中更新和查询MongoDB文档:Shelly
Shelly.js
What is it?
能够让在Mongo shell中构建查询和更新 MongoDB 更加方便。采用 JS 开发用于 MongoDB的 JS Shell。
Why did you build it?
I just got tired of writing really difficult queries for updating a few records. I got tired of hitting the shell window width and flubbing bracket placement.
What can I do with it?
- Build up queries with
and_where
,and_has
- Easily set your scope, call
.set('key', value)
, then save to make editing documents painless - Update documents like an ORM class
- Pluck out values from ambiguaous paths
.get('my.really.deep.path')
Example use..
Find a single record by id
Mongo
db.contacts.find({ _id : ObjectId('5489ea63c96a880167462784') })`
Shelly
var c = Shelly('contacts') c.find('5489ea63c96a880167462784') //or c.first('5489ea63c96a880167462784')
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!