REST neq operator not working

179 views
Skip to first unread message

Partap Davis

unread,
Aug 31, 2014, 8:42:13 PM8/31/14
to loopb...@googlegroups.com
I'm trying to query for a list of "job" instances in which the status is not "done":


But I'm getting:

{
  • error
    {
    • name"MongoError",
    • status500,
    • message"exception: invalid operator: $neq",
    • stack"MongoError: exception: invalid operator: $neq at Object.toError (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/utils.js:114:11) at /Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/db.js:1130:31 at /Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/db.js:1847:9 at Server.Base._callHandler (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/base.js:445:41) at /Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/server.js:478:18 at [object Object].MongoReply.parseBody (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) at [object Object].<anonymous> (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/server.js:436:20) at [object Object].EventEmitter.emit (events.js:107:17) at [object Object].<anonymous> (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13) at [object Object].EventEmitter.emit (events.js:110:17) at Socket.<anonymous> (/Users/partap/src/etr/mmlive/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/connection.js:439:22) at Socket.EventEmitter.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:159:16) at Socket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:514:20) ",
    • errmsg"exception: invalid operator: $neq",
    • code10068,
    • ok0
    }
}

The mongodb operator is actually called $ne, but if I use "[ne]", I just get 0 records back, when there are 26 records that should match...

In this case, I can get the desired result if I use the "nlike" operator, which I'm using right now as a workaround, but that seems wasteful, and might not always work...

Thanks,
-partap

Raymond Feng

unread,
Sep 2, 2014, 12:33:50 PM9/2/14
to Partap Davis, loopb...@googlegroups.com
It’s a bug. I’ll fix it.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages