Skip to content

bgbhavesh/aggregare-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

input config

// options:
// {
//     caseSensitive: false;
//     searchFields: ["",""];
//     searchText: "";  #String
//     match: {};       
//     sort: null;      # {createdBy: -1}
//     limit: null;     # Numeric 
//     skip: null;      # Numeric 
//     project: null;   # {"test" : 1}
// }

output will be

[ { '$match': { '$or': [{test:{ '$regex': 'test' }, '$option': 'i'}] } },
      { '$sort': { createdBy: -1 } },
      { '$skip': 0 },
      { '$limit': 10 },
      { '$project': { test: 1 } } ]

aggregate query for mongo db

cont aggreateQuery = require('aggregare-query');

npm test

About

get aggregate query for mongo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published