File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/mongodb" ,
3- "version" : " 0.1.1 " ,
3+ "version" : " 0.1.2 " ,
44 "description" : " Pipedream MongoDB Components" ,
55 "main" : " mongodb.app.mjs" ,
66 "keywords" : [
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export default {
66 key : "mongodb-new-document" ,
77 name : "New Document" ,
88 description : "Emit new an event when a new document is added to a collection" ,
9- version : "0.0.9 " ,
9+ version : "0.0.10 " ,
1010 type : "source" ,
1111 dedupe : "unique" ,
1212 props : {
@@ -48,10 +48,14 @@ export default {
4848 this . db . set ( "lastTs" , lastTs ) ;
4949 } ,
5050 getTs ( doc ) {
51+ const tsValue = doc [ this . timestampField ] ;
52+ if ( typeof tsValue === "string" ) {
53+ return new Date ( tsValue ) . getTime ( ) ;
54+ }
5155 try {
52- return JSON . parse ( doc [ this . timestampField ] ) ;
56+ return JSON . parse ( tsValue ) ;
5357 } catch {
54- return doc [ this . timestampField ] ;
58+ return tsValue ;
5559 }
5660 } ,
5761 convertToTimestamp ( timestampStr ) {
You can’t perform that action at this time.
0 commit comments