mongoplusplus 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
- # Mongoplus
1
+ # mongoplusplus
2
2
 
3
3
  ## Overview
4
4
 
5
- `mongoplus` is a Node.js package designed to facilitate load balancing of read and write operations across multiple MongoDB databases. It simplifies database connection management, schema definition, model building, and CRUD operations execution.
5
+ `mongoplusplus` is a Node.js package designed to facilitate load balancing of read and write operations across multiple MongoDB databases. It simplifies database connection management, schema definition, model building, and CRUD operations execution.
6
6
 
7
7
  ## Installation
8
8
 
9
- Install Mongoplus via npm:
9
+ Install mongoplusplus via npm:
10
10
 
11
11
  ```bash
12
- npm install mongoplus
12
+ npm install mongoplusplus
13
13
  ```
14
14
 
15
15
  importing
16
16
  ```node
17
- const mongoplus = require('mongoplus');
17
+ const mongoplusplus = require('mongoplusplus');
18
18
  ```
19
19
  ##Initialing
20
20
  ```node
@@ -22,7 +22,7 @@ const dbname = 'testforUP';
22
22
 
23
23
  const mongoURI1 = `mongodb+srv://xxxxx:xxxxxx@cluster0.xxxxx.mongodb.net/${dbname}?retryWrites=true&w=majority`;
24
24
  const mongoURI2 = `readonly:mongodb+srv://xxxxxxx:xxxxxx@cluster0.xxxxxx.mongodb.net/${dbname}?retryWrites=true&w=majority`;
25
- const mongodb = new mongoplus([mongoURI1, mongoURI2]);
25
+ const mongodb = new mongoplusplus([mongoURI1, mongoURI2]);
26
26
 
27
27
  ```
28
28
  ##connecting database
package/mongoplus.js CHANGED
@@ -188,7 +188,7 @@ class MongoModel {
188
188
 
189
189
  async findOne(dbIndex, filter, chain = {}) {
190
190
  var currentModel = this.model[dbIndex]
191
- var chain = pair.chain;
191
+
192
192
  if (chain.skip && chain.limit && chain.sort) {
193
193
  currentModel.findOne(filter).skip(chain.skip).limit(chain.limit).sort(chain.sort)
194
194
  } else if (chain.skip && chain.limit) {
@@ -211,7 +211,7 @@ class MongoModel {
211
211
 
212
212
  async find(dbIndex, filter, chain = {}) {
213
213
  var currentModel = this.model[dbIndex]
214
- var chain = pair.chain;
214
+
215
215
  if (chain.skip && chain.limit && chain.sort) {
216
216
  currentModel.find(filter).skip(chain.skip).limit(chain.limit).sort(chain.sort)
217
217
  } else if (chain.skip && chain.limit) {
@@ -232,7 +232,7 @@ class MongoModel {
232
232
  //=======================
233
233
  async findById(dbIndex, filter, chain = {}) {
234
234
  var currentModel = this.model[dbIndex]
235
- var chain = pair.chain;
235
+
236
236
  if (chain.skip && chain.limit && chain.sort) {
237
237
  currentModel.findById(filter).skip(chain.skip).limit(chain.limit).sort(chain.sort)
238
238
  } else if (chain.skip && chain.limit) {
@@ -254,7 +254,7 @@ class MongoModel {
254
254
  //==========================
255
255
  async findById(dbIndex, filter, chain = {}) {
256
256
  var currentModel = this.model[dbIndex]
257
- var chain = pair.chain;
257
+
258
258
  if (chain.skip && chain.limit && chain.sort) {
259
259
  currentModel.findById(filter).skip(chain.skip).limit(chain.limit).sort(chain.sort)
260
260
  } else if (chain.skip && chain.limit) {
package/package.json CHANGED
@@ -1,15 +1,41 @@
1
1
  {
2
2
  "name": "mongoplusplus",
3
- "version": "1.0.0",
4
- "description": "A mongoose extanded library for building complex data models.in a multi tanannt architecture ",
3
+ "version": "1.0.2",
4
+ "description": "load balancing of read and write operations across multiple MongoDB servers ",
5
5
  "main": "mongoplus.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "author": "somen das(somen6562@gmail.com)",
10
+ "keywords": [
11
+ "MongoDB",
12
+ "Database",
13
+ "ORM",
14
+ "Wrapper",
15
+ "Mongoose",
16
+ "Multi-Database",
17
+ "Data Management",
18
+ "Async Operations",
19
+ "Scalable",
20
+ "Readability",
21
+ "Performance",
22
+ "Node.js",
23
+ "Worker Threads",
24
+ "Connection Pooling",
25
+ "Schema Management",
26
+ "CRUD Operations",
27
+ "Document-Oriented",
28
+ "Distributed",
29
+ "Replication",
30
+ "Sharding",
31
+ "load balancing",
32
+ "multiple database",
33
+ "Aggregation Framework"
34
+ ],
10
35
  "license": "ISC",
11
36
  "dependencies": {
12
37
  "mongoose": "^6.3.5",
13
- "mongoose-sequence": "^5.3.1"
38
+ "mongoose-sequence": "^5.3.1",
39
+ "mongoplusplus": "^1.0.1"
14
40
  }
15
41
  }