簡化在Mongo shell中更新和查詢MongoDB文檔:Shelly

jopen 9年前發布 | 13K 次閱讀 Shelly MongoDB NoSQL數據庫

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.baiduhome.net/lib/view/home/1418374812839

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!