Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Can I use the same key for nested bucket and filed in a bucket/ #728

Open
zhengxiaoyao0716 opened this issue Sep 20, 2017 · 1 comment
Open

Comments

@zhengxiaoyao0716
Copy link

How to understand the comments of bucket.Get mehod?
It says that Returns a nil value if the key does not exist or if the key is a nested bucket.,
Then if I could do something like those:

b.Put(key, value)
b.CreateBucket(key)

value := b.Get(key)
bucket := b.Bucket(key)

Is it a correctly and recommend usage?
What my means is, is there no-interference each other between field and nested bucket?

@zhengxiaoyao0716
Copy link
Author

Well, I take a try and found that, it was forbid to use same key with conflict value. This maybe more rigovous, and I suggest that if you can add this as a notice to the code comments?
And in ForEach function, I found that the v param of the callback would be nil if it is actually a bucket, but nothing statement for this behavour in the comments found.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant