Skip to content
This repository was archived by the owner on Mar 9, 2019. It is now read-only.
This repository was 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

Description

@zhengxiaoyao0716

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?

Activity

  1. zhengxiaoyao0716 commented on Sep 20, 2017

    @zhengxiaoyao0716
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions