Closed henri9813 closed 3 years ago
Golang does not support this syntax:
result := []Book
You should either create a new instance of a slice using make
or declare it via literal.
result := make([]Book,0)
// or
result2:=[]Book{}
FindAll example could be good but I think when developers learn how to search with query parameters, so they can guess how should they return all documents (empty query)
Hello,
I'm sorry, but golang support this syntax.
I'm currently using it
var result []Book
err := myCollection.SimpleFind(&result, bson.D{})
I agree with you for the documentation
Oh, wait, we don't do the same things.
In my case, i just declare the array without instanciate it.
You declare an empty array in your case.
My first message is wrong ...
I close the issue, sorry for the wasted time.
Describe the bug
Syntax is wrong
Should be:
Or maybe i miss something ?
Additionnaly, maybe add the FindAll method example:
best regards