Skip to content

Commit

Permalink
3.3.0 add back whole oplog update
Browse files Browse the repository at this point in the history
  • Loading branch information
renzholy committed Jul 23, 2018
1 parent 5d71e51 commit 9c74bba
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 57 deletions.
75 changes: 23 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongo-es",
"version": "3.2.12",
"version": "3.3.0",
"description": "A MongoDB to Elasticsearch connector",
"keywords": [
"mongodb",
Expand Down Expand Up @@ -42,12 +42,12 @@
"rx": "4.1.0"
},
"devDependencies": {
"@types/elasticsearch": "5.0.24",
"@types/lodash": "4.14.110",
"@types/mongodb": "3.1.1",
"@types/elasticsearch": "5.0.25",
"@types/lodash": "4.14.112",
"@types/mongodb": "3.1.2",
"@types/rx": "4.1.1",
"ava": "0.25.0",
"nodemon": "1.17.5",
"nodemon": "1.18.3",
"prettier": "1.13.7",
"source-map-support": "0.5.6",
"typescript": "2.9.2"
Expand Down
10 changes: 10 additions & 0 deletions src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ export default class Processor {
console.debug('ignoreUpdate', oplog)
return null
}
if (_.keys(oplog.o).find(key => !key.startsWith('$'))) {
return this.transformer(
'upsert',
{
_id: oplog.o2._id,
...oplog.o,
},
oplog.ts,
)
}
const old = this.task.transform.parent
? await this.elasticsearch.search(oplog.o2._id.toHexString())
: await this.elasticsearch.retrieve(oplog.o2._id.toHexString())
Expand Down

0 comments on commit 9c74bba

Please sign in to comment.