gocrud
gocrud copied to clipboard
Getting inconsistent json data back
Hello!
Thanks for this wonderful work with the graph data model, really clever!
I have tried to a couchbase (of course more databases ;)) , you can see it here https://github.com/lundin/gocrud/blob/master/drivers/couchbase/couchbase.go
But the problem is the inconsistent json response i get from different runs with the same query. Sometimes i get the full response/fields back and sometimes something is lacking.
First run missing some fields on post 2:
{ ' "Post": [ ' ' { ' ' ' "id": "hJ8BDrBuKo", ' ' ' "kind": "Post", ' ' ' "ts_millis": 0 ' ' }, ' ' { ' ' ' "body": "You can search for cat videos here", ' ' ' "id": "CNnDRX9CLW", ' ' ' "kind": "Post", ' ' ' "source": "991", ' ' ' "ts_millis": 1443789962726 ' ' } ' ], ' "id": "991", ' "kind": "User", ' "ts_millis": 0
}
Same query another try get full response from post2:
{ ' "Post": [ ' ' { ' ' ' "body": "You can search for cat videos here", ' ' ' "id": "CNnDRX9CLW", ' ' ' "kind": "Post", ' ' ' "source": "991", ' ' ' "tags": [ ' ' ' ' "search", ' ' ' ' "cat", ' ' ' ' "videos" ' ' ' ], ' ' ' "ts_millis": 1443789962726, ' ' ' "url": "www.google.com" ' ' }, ' ' { ' ' ' "body": "This is my second post!", ' ' ' "id": "hJ8BDrBuKo", ' ' ' "kind": "Post", ' ' ' "source": "991", ' ' ' "ts_millis": 1443789962763, ' ' ' "url": "www.google.com" ' ' } ' ], ' "id": "991", ' "kind": "User", ' "ts_millis": 0
}
Hmm.. strange. I'll have a look today.
Hey lundin,
Could you please add the commands / instructions for setting up couchbase, being run via docker? I could look for all that, but would cost me at least some time getting my head around a new database.
Ideally, we should have tests for all stores, using similar technique as in search. Then we could test the various datastores by modifying wercker to bring up various docker instances and shoot queries etc.
Any update?