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

mongochangestream

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongochangestream - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 0.5.0
* Pass `QueueOptions` to `runInitialScan`.
# 0.4.0

@@ -2,0 +6,0 @@

3

dist/mongoChangeStream.d.ts
import { Collection } from 'mongodb';
import { ProcessRecord, ProcessRecords } from './types.js';
import type { default as Redis } from 'ioredis';
import { QueueOptions } from 'prom-utils';
export declare const initSync: (redis: Redis) => {
runInitialScan: (collection: Collection, processRecords: ProcessRecords, batchSize?: number) => Promise<void>;
runInitialScan: (collection: Collection, processRecords: ProcessRecords, options?: QueueOptions) => Promise<void>;
processChangeStream: (collection: Collection, processRecord: ProcessRecord, pipeline?: Document[]) => Promise<void>;
reset: (collection: Collection) => Promise<void>;
};

@@ -31,5 +31,5 @@ "use strict";

/**
* Run initial collection scan.
* Run initial collection scan. `options.batchSize` defaults to 500.
*/
const runInitialScan = async (collection, processRecords, batchSize = 100) => {
const runInitialScan = async (collection, processRecords, options) => {
debug('Running initial scan');

@@ -56,3 +56,3 @@ // Redis keys

// Create queue
const queue = (0, prom_utils_1.batchQueue)(_processRecords, { batchSize });
const queue = (0, prom_utils_1.batchQueue)(_processRecords, options);
// Query collection

@@ -59,0 +59,0 @@ const cursor = collection

{
"name": "mongochangestream",
"version": "0.4.0",
"version": "0.5.0",
"description": "Sync MongoDB collections via change streams into any database.",

@@ -5,0 +5,0 @@ "author": "GovSpend",

@@ -57,3 +57,3 @@ # Mongo Change Stream

processRecord: ProcessRecord,
batchSize = 100
options?: QueueOptions
): Promise<void> => ...

@@ -60,0 +60,0 @@

@@ -6,3 +6,3 @@ import { ChangeStreamInsertDocument, Collection, ObjectId } from 'mongodb'

import type { default as Redis } from 'ioredis'
import { batchQueue } from 'prom-utils'
import { batchQueue, QueueOptions } from 'prom-utils'

@@ -34,3 +34,3 @@ const debug = _debug('mongodbChangeStream')

/**
* Run initial collection scan.
* Run initial collection scan. `options.batchSize` defaults to 500.
*/

@@ -40,3 +40,3 @@ const runInitialScan = async (

processRecords: ProcessRecords,
batchSize = 100
options?: QueueOptions
) => {

@@ -64,3 +64,3 @@ debug('Running initial scan')

// Create queue
const queue = batchQueue(_processRecords, { batchSize })
const queue = batchQueue(_processRecords, options)
// Query collection

@@ -67,0 +67,0 @@ const cursor = collection

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