When updating cross-reference items in Inventory, we get a duplicate key error. Looking into it, we discovered that when updating, the query does not filter by InventoryID only by SubItemID, AlternateID,AlternateType and BaccountID. This causes a problem when updating or deleting. Deleting a record will actually delete all items having the same subitemid, alternateid,alternatetype and baccountid but different InventoryID. Has this happened to anyone else? We are using version 5.1
Related
I checked https://github.com/hyperledger/composer/issues/543 https://github.com/hyperledger/composer/issues/1640 and ORDER BY not working in named query but they did not resolve my problem completely.
I added a custom index field in couchdb to sort by data.transactionTimestamp but my app still got the "no index exists for sort field" error.. Anyone knows how can I fix this? I only have GET and POST methods allowed for couchdb. I copy pasted my http://my_public_id:30984/channel1/_index records below since I dont have enough points to post picture. Sorry for the inconvenience and thank so much!
{"total_rows":4,"indexes":[{"ddoc":null,"name":"_all_docs","type":"special","def":{"fields":[{"_id":"asc"}]}},{"ddoc":"_design/26aaccbebd3e25d7dd8c6b8d7bcc25f6891cbfad","name":"26aaccbebd3e25d7dd8c6b8d7bcc25f6891cbfad","type":"json","def":{"fields":[{"data.transactionTimestamp":"asc"}],"partial_filter_selector":{}}},{"ddoc":"_design/c6dfa94edfc6620749e92789507a2ca946b98424","name":"c6dfa94edfc6620749e92789507a2ca946b98424","type":"json","def":{"fields":[{"data.transactionTimestamp":"asc"}],"partial_filter_selector":{}}},{"ddoc":"_design/e1d4f1e1212b6e8c3d6adabf71228868de791714","name":"e1d4f1e1212b6e8c3d6adabf71228868de791714","type":"json","def":{"fields":[{"transactionTimestamp":"asc"}],"partial_filter_selector":{}}}]}
Updated: query file on hyperledger
I got a strange issue regarding Domino fulltext-indexing:
When I save a document, and update the index (updall or via database properties) the index seems to still contain the old values.
So, if I update the field, lets say, 'Assignee' from value 'x' to value'y' and then update the index I can still find the document via FTSearch "[Assignee] = x", but not with "[Assignee] = y".
But the document has already the value "y" in it.
The index is only correct again, when I recreate it completely.
I'm using Domino 9.0.1
Is that some permission problem, or why would this happen?
After purging a set of documents in a Couch database, some view results contain documents which are actually not there in the database. When accessing such documents following error message is returned
{"error":"not_found","reason":"missing"}
Also the view results contain duplicate entries for some of such "missing" documents.
Some of these docs contain conflicted revisions as well.
Following is a simple view which lists such documents. According to the view, there should not be duplicate results.
function(doc) {
if (doc.documentType == 'theDocType') {
emit(theDocType, doc);
}
}
I created a new document with an id of a "missing" document, and tried purging it again (giving the new rev and all the conflicting revs). But after purging, the view results remained same as earlier.
Any idea what has caused this and how to resolve this problem ?
I just recently had this issue too and found your question.
I fixed it by deleting the view records, stored here on Windows
"...\couchdb.2.1.1\data\.dbname_design\mrview\*.view"
here on Linux
<couch data directory>/.dbname_design\mrview*.view (usually /var/lib/couchdb or /usr/local/var/lib/couchdb)
Each .view is named with an md5, delete them all, then restart the service. Then request the view again and it will rebuild this index, it might take 2 or 3 attempts before it builds it properly depending on the size of the database.
Hopefully someone can add what the linux path is.
I have some nodes who contain the items value which seems to be initialized by default from Kendo with the value "[]" everytime!
I want to completely delete the "items" field from the node but I can't seem to find any method for attribute deleting.
I try to access the nodes through dataItem and I tried dataItem.set("items",undefined) but still I don't think it helped.I'm trying to delete the items field because there seems to be a problem with that initialization done by kendo and I can't append new nodes to them and I think it's because of it...
EDIT :
It seems that kendo.observableHierarchy(data) initializes every tree node with no children (and therefore without an items attribute all).And by initializing I mean that everytime I show the dataSource the nodes that have no children have the "items":[] attribute added to them automatically!
I tried appending nodes through treeview.dataItem(treeview.select()).append() but I found out that this method doesn't work on "old" nodes that have the "items":[] attribute added to them by kendo,so "old" nodes are all the nodes that have been loaded on the tree from page load and therefore were saved on the JSON file.
And I say "old" because if I append a new node it doesn't have the "items" field and the .append() mentioned above works pretty fine on it adding a node and updating the dataSource..This .append() works pretty fine also on "old" nodes that already have children and so their "items" field is not modified by kendo because it already exists.
I've just discovered something interesting about Kendo's suggested answer at: http://www.telerik.com/forums/clear-all-nodes
Using their code suggestion, will also delete the .items attribute:
$(".k-treeview").data("kendoTreeView").remove(".k-item");
Deleting an object field is delete XXX. Ive updated the [fiddle] (jsfiddle.net/OnaBai/UC3uW/1) by adding a third option calledremove` but unless I misunderstood what you were suggesting, it does not solve the problem. I'm afraid that this is a feature in KendoUI that does not manage HierarchicalDataSources as we expect.
I have a CouchDB database in production. One of the documents has been edited (in Futon by an other developer).
And it's lost it's ID (don't ask me how he did it).
So now the document's id is an empty string, which makes it impossible to edit or delete via Futon.
Is there a way I could hack into CouchDB to delete that document anyway ?
I couldn't delete the document. But the database itself could be deleted.
And I couldn't reproduce the bug in locale. The other developer says he just removed the _id param and saved. I don't know what happened in CouchDB when he did it. But when I do so, it only recreates a new document (as we'd expect it to do).
So I've been using couch_docs to retrieve the datas locally.
As the id is empty, couch_docs doesn't imports it. So you don't even need to delete it manually.
Then I reimport all the records in an other database. I change the references to the database name in my config and everything works fine.
Destroying the database is not a problem even though there's an empty id.
Technically, a document ID is immutable so actually changing the _id field is not directly possible. Perhaps another document was created as a copy of the first?
A bug in CouchDB 1.1.0 allowed update functions to create empty string IDs.
A similar question asks about this and I gave a walkthrough of deleting empty ids there.
I haven't tried it but LoveSeat is supposed to be able to open and edit couchedb files...
This can be caused (and fixed!) by some error checking CouchDB was missing for _update handlers, as explained in How do you delete a couchdb document with an empty "" document id?