We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code demonstrates this problem.
package main import ( "github.com/mikejs/gomongo/mongo" "fmt" "os" ) func main() { conn, _ := mongo.Connect("127.0.0.1") collection := conn.GetDB("test").GetCollection("test_collection") doc, _ := mongo.Marshal(map[string]string{ "_id": "doc1", "title": "A Mongo document", "content": "Testing, 1. 2. 3.", }) collection.Insert(doc) doc, err := mongo.Marshal(map [string]string{"getlasterror" : "1"}) if err != nil { fmt.Println(err) os.Exit(1) } doc, err = conn.GetDB("test_collection").Command(doc) if err != nil { fmt.Println(err) os.Exit(1) } m := make(map[string]string) err = mongo.Unmarshal(doc.Bytes(), m) if err != nil { //DEBUG, the error is here fmt.Println(err) os.Exit(1) } collection.Drop() }
The text was updated successfully, but these errors were encountered:
Try change map [string]string{"getlasterror" : "1"} to map [string]int{"getlasterror" : 1}
Sorry, something went wrong.
No branches or pull requests
The following code demonstrates this problem.
The text was updated successfully, but these errors were encountered: