简化在Mongo shell中更新和查询MongoDB文档:Shelly

jopen 10年前

Shelly.js

shellyjs-logo.png

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')

项目主页:http://www.open-open.com/lib/view/home/1418374812839