1.0.3 • Published 2 years ago

nmongo v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Axios

connect to mongodb and perform CRUD operations

listRecordsByContainsText(dbUri, dbName, collectionName, query, callback)

Pass query parameter like below. var query = { 'columnname': new RegExp(txtToSearch, 'i') };

listByIds(dbUri, dbName, collectionName, ids, callback)

call this method like this main.listByIds(uri, dbname, collection, '62ca423ff60cea80458d7f8d', (err, result) => {})

get(dbUri, dbName, collectionName, id, callback)

call this method like this main.get(uri, dbname, collection, '62ca423ff60cea80458d7f8d', (err, result) => {})

other methods

  • insert(dbUri, dbName, collectionName, data, callback)
  • delete(dbUri, dbName, collectionName, id, callback)

update(dbUri, dbName, collectionName, id, propertyArray, callback)

call this method like this var propertyArray = { age: 40 }; main.update(uri, dbname, collection, '62ca4f6d903fd1ea9c85efaa',propertyArray, (err, result) => {})

InsertOrUpdate(dbUri, dbName, collectionName, id, propertyArray, callback)

call this method like this var propertyArray = { age: 40, address:'om sai hospital' }; main.InsertOrUpdate(uri, dbname, collection, '62ca4f6d903fd1ea9c85efab',propertyArray, (err, result) => {