Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

senter-mongo-repository

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

senter-mongo-repository - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

6

mongoReposotory.js
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);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc