New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

q-to-mongo

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q-to-mongo

q-to-mongo ====

latest
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

q-to-mongo

query string to mongodb query

Installation

yarn add q-to-mongo

Example

const q2mongo = require('q-to-mongo');

/*
{
  name: "Jinwoo",
  age:  10
}
*/
console.log(q2mongo('name:Jinwoo age:10'));
/*
{
  name: "Jinwoo",
  age:  10,
  gender: { $not: 'male' }
}
*/
console.log(q2mongo('name:Jinwoo age:10 -gender:male'));
/*
{
  age:  { $gt: 10 },
}
*/
console.log(q2mongo('age:>10'));

String Literal

/*
{
  name: "Long Jinwoo",
  age:  10
}
*/
console.log(q2mongo('name:"Long Jinwoo" age:10'));

Todo

  • user query to db field adaptor(converter)
  • time strings such as last_login:>3d

FAQs

Package last updated on 14 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts