Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link Two Keys in a bucket - Loosing the values for the keys #214

Open
Balasundararao opened this issue May 28, 2014 · 0 comments
Open

Link Two Keys in a bucket - Loosing the values for the keys #214

Balasundararao opened this issue May 28, 2014 · 0 comments

Comments

@Balasundararao
Copy link

var releasebucket = "Release_bucket9";
var release = {
id : 1,
name : "ABCD",
parent : 0
}
db.save(releasebucket, release.id, release, {links:[{bucket:releasebucket, key:"2", tag:"2"}]});

var release = {
id : 2,
name : "DEFC",
parent : 1
}
db.save(releasebucket, release.id, release);
Links are working fine. for the above case.

i added a new record :
var release = {
id : 3,
name : "JKLM",
parent : 1
}
Trying to update the key "1" meta links with the below syntax..

db.get(releasebucket, 1, function(err,parent_data, parent_meta){
    if(err) throw err;
    parent_meta.links.push({bucket:releasebucket, key:3, tag:3});
    db.save(releasebucket, 1, parent_data, parent_meta);
});

able to get the link values : curl http://localhost:8098/buckets/Release_bucket9/keys/1/,,_

when i try to access the key value( "curl http://localhost:8098/buckets/Release_bucket9/keys/1"). values become empty for key "1". Do you have any suggestions how to retain the original values of key 1:

@Balasundararao Balasundararao changed the title Link Two Keys in a bucket Link Two Keys in a bucket - Loosing the values for the keys May 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant