Created
May 8, 2013 17:25
-
-
Save mzafer/5542043 to your computer and use it in GitHub Desktop.
Extension of the scripts to test issue #64 (https://github.com/richardwilly98/elasticsearch-river-mongodb/tree/master/resources/issues/64) to add script for deletion of document is state is changed. The changes done are _02_mongodb-river-author.json -> Added "script" to delete the document if state == "INACTIVE"
_03-import-document.js -> Added "…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use mydb | |
var author = | |
{ | |
"_id": "herge", | |
"name": "Herge", | |
"nationality": "Belge", | |
"state":"ACTIVE" | |
} | |
db.authors.save(author) | |
var book = { | |
"_parentId": "herge", | |
"name": "Titin au Congo", | |
"genre": "Bande dessinee", | |
"publisher": "Herge" | |
} | |
db.books.save(book) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use mydb | |
var o = db.authors.findOne({"name": "Herge"}) | |
o.state = 'INACTIVE'; | |
db.authors.save(o) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment