senter-mongo-repository
Advanced tools
Comparing version 2.0.0 to 2.0.1
const MongoClient = require('mongodb').MongoClient | ||
const uuidv4 = require('uuid/v4') | ||
const { uuid } = require('uuidv4') | ||
@@ -120,3 +120,3 @@ const options = { | ||
if (!document.id) { | ||
document._id = uuidv4(); | ||
document._id = uuid() | ||
} | ||
@@ -161,3 +161,3 @@ else { | ||
if (!document.id) { | ||
document._id = uuidv4(); | ||
document._id = uuid() | ||
} | ||
@@ -164,0 +164,0 @@ else { |
{ | ||
"name": "senter-mongo-repository", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Contain methods to work with mongo db", | ||
@@ -13,3 +13,3 @@ "main": "mongoReposotory.js", | ||
"mongodb": "^4.1.2", | ||
"uuid": "^8.3.2" | ||
"uuidv4": "^6.2.12" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": { |
const MongoRepository = require('./../mongoReposotory') | ||
const { MongoClient } = require('mongodb') | ||
const uuidv4 = require('uuid/v4') | ||
const { uuid } = require('uuidv4') | ||
@@ -60,3 +60,3 @@ const connectionString = 'mongodb+srv://dev:xeVfBSSXEmDCu32aQUHtRte572jOA03z@sandbox-5zqkh.mongodb.net/test?poolSize=20&writeConcern=majority&retryWrites=true' | ||
// test("should create with provided id", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -233,3 +233,3 @@ // name: "should create with provided id", | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
@@ -265,3 +265,3 @@ // await repository.update(id, userId, document); | ||
// test("should delete", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -306,3 +306,3 @@ // _id: id, | ||
// test("should mark deleted", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -350,3 +350,3 @@ // _id: id, | ||
// test("should retrieve exisiting object by id and userId", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -371,3 +371,3 @@ // _id: id, | ||
// test("should return null if only userId does not match", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -388,3 +388,3 @@ // _id: id, | ||
// test("should retrieve exisiting object by id", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
// const document = { | ||
@@ -409,3 +409,3 @@ // _id: id, | ||
// test("should return null when object doesn't exist. By id and userId", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
@@ -419,3 +419,3 @@ // const result = await repository.getById(id, userId); | ||
// test("should retrieve exisiting object by id", async () => { | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
@@ -472,6 +472,6 @@ // const result = await repository.getById(id); | ||
// test("should return all records by filter condition", async () => { | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
@@ -509,6 +509,6 @@ // const col = client.db(dbName).collection(collectionName); | ||
// test("should return empty list if no records found", async () => { | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
@@ -546,6 +546,6 @@ // const col = client.db(dbName).collection(collectionName); | ||
// test("should return requested fields only if projection is set", async () => { | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
@@ -589,6 +589,6 @@ // const col = client.db(dbName).collection(collectionName); | ||
// test("should sort", async () => { | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
@@ -631,6 +631,6 @@ // const col = client.db(dbName).collection(collectionName); | ||
// test("should not return deleted records ", async () => { | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuidv4()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
// ids.push(uuid()); | ||
@@ -734,3 +734,3 @@ // const col = client.db(dbName).collection(collectionName); | ||
// id = uuidv4(); | ||
// id = uuid(); | ||
@@ -737,0 +737,0 @@ // await repository.upsert(id, userId, document); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
35654
+ Addeduuidv4@^6.2.12
+ Added@types/uuid@8.3.4(transitive)
+ Addeduuidv4@6.2.13(transitive)
- Removeduuid@^8.3.2