You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue with Using c.NewDocument() in v2 Branch Documentation
I'm experiencing issues using the NewDocument function from the "github.com/ostafen/clover/v2" package as described in the documentation.
Original Code
According to the documentation, I should be able to use:
db, _:=c.Open("clover-db")
db.CreateCollection("myCollection") // create a new collection named "myCollection"// insert a new document inside the collectiondoc:=c.NewDocument()
doc.Set("hello", "clover!")
However, this code does not work.
Workaround
To make it work, I had to import the document package separately and use its NewDocument() function:
import (
c "github.com/ostafen/clover/v2"
cloverDocument "github.com/ostafen/clover/v2/document"
)
db, _:=c.Open("clover-db")
db.CreateCollection("myCollection") // create a new collection named "myCollection"// insert a new document inside the collectiondoc:=cloverDocument.NewDocument()
doc.Set("hello", "clover!")
I'll be submitting a PR to address this issue, but I wanted to raise it first so we can discuss and resolve it together.
The text was updated successfully, but these errors were encountered:
Issue with Using
c.NewDocument()
in v2 Branch DocumentationI'm experiencing issues using the
NewDocument
function from the "github.com/ostafen/clover/v2" package as described in the documentation.Original Code
According to the documentation, I should be able to use:
However, this code does not work.
Workaround
To make it work, I had to import the
document
package separately and use itsNewDocument()
function:I'll be submitting a PR to address this issue, but I wanted to raise it first so we can discuss and resolve it together.
The text was updated successfully, but these errors were encountered: