Socket
Socket
Sign inDemoInstall

mongochangestream

Package Overview
Dependencies
Maintainers
1
Versions
56
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.10.0 to 0.11.0

4

CHANGELOG.md

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

# 0.11.0
* Prepend `pipeline` with omit pipeline if `omit` is passed to `initSync`.
# 0.10.0

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

8

dist/mongoChangeStream.js

@@ -39,3 +39,3 @@ "use strict";

const omit = options?.omit;
const defaultPipeline = omit ? (0, util_js_1.generatePipelineFromOmit)(omit) : [];
const omitPipeline = omit ? (0, util_js_1.generatePipelineFromOmit)(omit) : [];
/**

@@ -99,4 +99,6 @@ * Run initial collection scan. `options.batchSize` defaults to 500.

* Process MongoDB change stream for the given collection.
* If omit is passed to `initSync` a pipeline stage that removes
* those fields will be prepended to the `pipeline` argument.
*/
const processChangeStream = async (collection, processRecord, pipeline) => {
const processChangeStream = async (collection, processRecord, pipeline = []) => {
// Redis keys

@@ -111,3 +113,3 @@ const { changeStreamTokenKey } = (0, exports.getKeys)(collection);

// Get the change stream as an async iterator
const changeStream = (0, changeStreamToIterator_js_1.default)(collection, pipeline || defaultPipeline, options);
const changeStream = (0, changeStreamToIterator_js_1.default)(collection, [...omitPipeline, ...pipeline], options);
// Consume the events

@@ -114,0 +116,0 @@ for await (const event of changeStream) {

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

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

@@ -46,3 +46,3 @@ import _ from 'lodash/fp.js'

const omit = options?.omit
const defaultPipeline = omit ? generatePipelineFromOmit(omit) : []
const omitPipeline = omit ? generatePipelineFromOmit(omit) : []
/**

@@ -115,2 +115,4 @@ * Run initial collection scan. `options.batchSize` defaults to 500.

* Process MongoDB change stream for the given collection.
* If omit is passed to `initSync` a pipeline stage that removes
* those fields will be prepended to the `pipeline` argument.
*/

@@ -120,3 +122,3 @@ const processChangeStream = async (

processRecord: ProcessRecord,
pipeline?: Document[]
pipeline: Document[] = []
) => {

@@ -134,3 +136,3 @@ // Redis keys

collection,
pipeline || defaultPipeline,
[...omitPipeline, ...pipeline],
options

@@ -137,0 +139,0 @@ )

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