You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using meteorhacks:aggregate succesfully for a while now to group article search results by category, (i'm rendering these results into an accordion control that allows each category's results to open and close by clicking the header for that category name) with the various inputs affecting the query output that results in an aggregate query that looks something like this:
While both of these work great on a mongo shell, with db.articles.aggregate(), the one with the $text: { $search: "Meteor" } term fails with an error:
(Note that these are both run against the same database, the issue exists locally in meteor mongo and on compose.io)
I20150501-16:55:10.893(-7)? Exception while invoking method 'getGroupedArticles' SyntaxError: Unexpected token $
I20150501-16:55:10.893(-7)? at Object.parse (native)
I20150501-16:55:10.893(-7)? at [object Object].Meteor.methods.getGroupedArticles (packages/mcms-articles/server/articles-server.js:73:1)
I20150501-16:55:10.894(-7)? at [object Object].methodMap.(anonymous function) (packages/meteorhacks:kadira/lib/hijack/wrap_session.js:160:1)
I20150501-16:55:10.894(-7)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20150501-16:55:10.894(-7)? at packages/ddp/livedata_server.js:648:1
I20150501-16:55:10.894(-7)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150501-16:55:10.894(-7)? at packages/ddp/livedata_server.js:647:1
I20150501-16:55:10.894(-7)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150501-16:55:10.894(-7)? at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)
I20150501-16:55:10.894(-7)? at packages/meteorhacks:kadira/lib/hijack/wrap_session.js:50:1
FYI, Without kadira enabled the output looks like this:
I20150501-17:10:19.905(-7)? Exception while invoking method 'getGroupedArticles' SyntaxError: Unexpected token $
I20150501-17:10:19.905(-7)? at Object.parse (native)
I20150501-17:10:19.906(-7)? at [object Object].Meteor.methods.getGroupedArticles (packages/mcms-articles/server/articles-server.js:73:1)
I20150501-17:10:19.906(-7)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20150501-17:10:19.906(-7)? at packages/ddp/livedata_server.js:648:1
I20150501-17:10:19.906(-7)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150501-17:10:19.906(-7)? at packages/ddp/livedata_server.js:647:1
I20150501-17:10:19.906(-7)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150501-17:10:19.906(-7)? at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)
I20150501-17:10:19.906(-7)? at packages/ddp/livedata_server.js:546:1```
I'm still relatively new at Meteor so I'm not sure how to debug this...
Has anyone been successful using text search within aggregates?
The text was updated successfully, but these errors were encountered:
timtrendlier
changed the title
Full Text Search with meteor-aggregate
Full $Text $Search with meteor-aggregate throws SyntaxError: Unexpected token $
May 4, 2015
I've been using meteorhacks:aggregate succesfully for a while now to group article search results by category, (i'm rendering these results into an accordion control that allows each category's results to open and close by clicking the header for that category name) with the various inputs affecting the query output that results in an aggregate query that looks something like this:
this is used in Meteor inside collection.aggregate() and it works beautifully and much faster than my old implementation. So far so good.
Recently I was tasked with improving this to add a text search, so I set up full text indexing and rewrote my code to produce queries like this:
While both of these work great on a mongo shell, with db.articles.aggregate(), the one with the
$text: { $search: "Meteor" }
term fails with an error:(Note that these are both run against the same database, the issue exists locally in meteor mongo and on compose.io)
FYI, Without kadira enabled the output looks like this:
I'm still relatively new at Meteor so I'm not sure how to debug this...
Has anyone been successful using text search within aggregates?
The text was updated successfully, but these errors were encountered: