Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-29989

goforestdb documentation is incorrect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • bug-backlog
    • 6.5.0
    • storage-engine
    • None
    • Untriaged
    • Unknown

    Description

      Problem

      The start out guide to goforestdb is incorrect:

      https://godoc.org/github.com/couchbase/goforestdb

      The following error is produce:

      ./main.go:12:7: db.Set undefined (type *forestdb.File has no field or method Set) 
      

      Steps to reproduce

      1. Copy the code from the documentation
      2. Execute the code

      Workaround

      The following works

      package main
       
      import "github.com/couchbase/goforestdb"
       
      func main() {
          // Open a database
          db, _ := forestdb.Open("test.fdb", nil)
          // Close it properly when we're done
          defer db.Close()
       
          // Open a Key Value store
          kvs, _ := db.OpenKVStore("kvs-01", nil)
          defer kvs.Close()
       
          // Store the document
          doc, _ := forestdb.NewDoc([]byte("key"), nil, []byte("value"))
          defer doc.Close()
          kvs.Set(doc)
       
          // Lookup the document
          doc2, _ := forestdb.NewDoc([]byte("key"), nil, nil)
          defer doc2.Close()
          kvs.Get(doc2)
       
          // Delete the document
          doc3, _ := forestdb.NewDoc([]byte("key"), nil, nil)
          defer doc3.Close()
          kvs.Delete(doc3)
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tai.tran Tai Tran (Inactive)
            pvarley Patrick Varley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty