I am running a web server application using node.js and javascript. I am writing json to the couchbase server using upsert to the openBucket. All works well except I have as part of my json structure
{test : {“1” : {“name”, “a”}, “2” : {“name” : “b”}}}
this seems to get converted in the database record to
{test : [ {“name”, “a”}, {“name” : “b”}]}
This is not what I want.
if I include a structure like
{test : {“A1” : {“name”, “a”}, “A2” : {“name” : “b”}}}
it maintains the json structure in the database.
How can I stop this from happening?
I have the same structure in my mobile app using couchbase and java and it gets stored properly in the mobile couchbase database.
Couchbase server - 5.0.1 community edition
node.js -v8,11,1
npm global packages are not always same version as local packages. (many of the packages are duplicated in both places.)
Trying to clean this up and have packages global.
I’m having trouble reproducing this, I’m using Couchbase 5.0.1 Community Edition and Node.js 8.11.1. I’m seeing the same as in my previous comment. There’s no chance that something somwhere in your code is doing something a bit odd and somehow converting the object to array?