FAQ
This seems like a common enough scenario that their is probably already a
module for it, so I'm asking before I start writing one :).

Given a generic free form text search input on a webpage I would like to
have it converted over to a query to be executed against my data. My
target is MongoDB like query instructions, but doesn't have to be MongoDB
as could easily transform it again.

Something like:

foo and bar

might result in something like:

{
   $or: [
     {name: /foo and bar/i},
     {description: /foo and bar/i},
     {$and: [
       {name: /foo/i},
       {name: /bar/i},
     ]},
     {$and: [
       {description: /foo/i},
       {description: /bar/i},
     ]},
     ...etc...
   ]
}

Has anyone already done something similar that is out there and easy to
include, or is this something that still needs to be created?

Thanks,
  - Jeremy

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAAhs7Eh8oPoDs6YH_X0xVjRXnnkMkB%3D5bW_2%2Bh3U1gSUXNctCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedNov 7, '14 at 7:29p
activeNov 10, '14 at 4:11p
posts3
users2
websitenodejs.org
irc#node.js

2 users in discussion

Jeremy Darling: 2 posts Greelgorke: 1 post

People

Translate

site design / logo © 2022 Grokbase