文件名称:
MongoDB查询的JavaScript实现Mingo.zip
开发工具:
文件大小: 237kb
下载次数: 0
上传时间: 2019-07-19
详细说明: Mingo 是 MongoDB 查询语言的 JavaScript 实现。Mingo 利用 MongoDB 风格查询,在客户端或者服务器端环境下,允许直接查询内存的 JavaScript 对象。特性:Comparisons Operators ($gt, $gte, $lt, $lte, $ne, $nin, $in)Logical Operators ($and, $or, $nor, $not)Evaluation Operators ($regex, $mod, $where)Array Operators ($all, $elemMatch, $size)Element Operators ($exists, $type)Aggregation Pipe line Operators ($group, $match, $project, $sort, $limit, $unwind, $skip)Conditional Operators ($cond, $ifNull)Group Operators ($addToSet, $sum, $max, $min, $avg, $push, $first, $last)Arithmetic Operators ($add, $divide, $mod, $multiply, $subtract)String Operators ($cmp, $strcasecmp, $concat, $substr, $toLower, $toUpper)Set Operators ($setEquals, $setIntersection, $setDifference, $setUnion, $setIsSubset, $anyElementTrue, $allElementsTrue)Projection Operators ($elemMatch, $slice)JSON stream filtering and projection. NodeJS only使用var Mingo = require(mingo); // or just access *Mingo* global in browser // setup the key field for your collection Mingo.setup({ key: _id // default }); // create a query with criteria // find all grades for homework with score >= 50 var query = new Mingo.Query({ type: "homework", score: { $gte: 50 } });搜索和过滤// filter collection with find() var cursor = query.find(collection); // shorthand with query criteria // cursor = Mingo.find(collection, criteria); // sort, skip and limit by chaining cursor.sort({student_id: 1, score: -1}) .skip(100) .limit(100); // count matches cursor.count(); // iterate cursor // iteration is forward only while (cursor.hasNext()) { console.log(cursor.next()); } // use first(), last() and all() to retrieve matched objects cursor.first(); cursor.last(); cursor.all(); // Filter non-matched objects ( var result = query.remove(collection); 标签:Mingo
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
相关搜索: