I am very new in couchDB. I have a problem with duplicated entries in my CouchDB database.
In order to solve it I have been reading this: Find The Duplicate value in CouchDb and it is very usuful.
To find duplicates entries I do in Futon
:
function(doc) {
if (doc.ismaster == true && doc.type == "article_aux"){
emit([doc.type,doc.id, doc.id_group], doc);
}
}
On Reduce Function
I have
_count
So a duplicated documents has the same id
and the same id_group
.
Here you can see an example about the duplicated entries
This is the Json
document structure for one document:
{
"_id": "013684e1d7da89c1b290666a957fd4ce",
"_rev": "1-c5f41865f78f0806c8df450794edeb1f",
"type": "article_aux",
"id": 1661,
"name": "STEWARTIA SP",
"security_time": 0,
"id_reason_type": 0,
"id_reason": 4,
"id_group": 3,
"dose": 2,
"id_unit_dose": 406,
"version": "0x000000004821A25D",
"ismaster": true
}
The field version
is an timestamp
The problem I have is I dont know how to remove the duplicated entries.