diff --git a/components/mongodb/package.json b/components/mongodb/package.json index d81276ff8cdc7..81c29d5f97493 100644 --- a/components/mongodb/package.json +++ b/components/mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/mongodb", - "version": "0.1.2", + "version": "0.1.3", "description": "Pipedream MongoDB Components", "main": "mongodb.app.mjs", "keywords": [ diff --git a/components/mongodb/sources/new-document/new-document.mjs b/components/mongodb/sources/new-document/new-document.mjs index a9f2c929264f9..280196df36d14 100644 --- a/components/mongodb/sources/new-document/new-document.mjs +++ b/components/mongodb/sources/new-document/new-document.mjs @@ -6,7 +6,7 @@ export default { key: "mongodb-new-document", name: "New Document", description: "Emit new an event when a new document is added to a collection", - version: "0.0.10", + version: "0.0.11", type: "source", dedupe: "unique", props: { @@ -29,7 +29,17 @@ export default { timestampField: { type: "string", label: "Timestamp Field", - description: "The key of a timestamp field, such as 'created_at' that is set to the current timestamp when a document is created. Must be of type Timestamp.", + description: "The key of a timestamp field, such as 'created_at' that is set to the current timestamp when a document is created.", + }, + timestampFieldType: { + type: "string", + label: "Timestamp Field Type", + description: "The type of the timestamp field", + default: "Timestamp", + options: [ + "Timestamp", + "Integer", + ], }, }, hooks: { @@ -49,6 +59,9 @@ export default { }, getTs(doc) { const tsValue = doc[this.timestampField]; + if (this.timestampFieldType === "Integer") { + return tsValue; + } if (typeof tsValue === "string") { return new Date(tsValue).getTime(); } @@ -77,7 +90,9 @@ export default { }; const query = { [this.timestampField]: { - $gt: this.convertToTimestamp(lastTs), + $gt: this.timestampFieldType === "Integer" + ? lastTs + : this.convertToTimestamp(lastTs), }, }; const documents = await collection.find(query).sort(sort) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5afea2c286d05..655e8c12839fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15484,14 +15484,6 @@ importers: specifier: ^6.0.0 version: 6.2.0 - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/cjs: {} - - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/esm: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/cjs: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/esm: {} - packages/ai: dependencies: '@pipedream/sdk':