good morning!!!!

Skip to content
Snippets Groups Projects
Commit 88f537ad authored by José Carlos Nieto's avatar José Carlos Nieto
Browse files

Looks like #13 conflicts with some mongod versions...

Looks like #13 conflicts with some mongod versions (https://travis-ci.org/upper/db/jobs/24479509), rolling back to old solution to test it a bit more.
parent 3a022d95
No related branches found
No related tags found
No related merge requests found
......@@ -201,11 +201,32 @@ func (self *Collection) Append(item interface{}) (interface{}, error) {
id = bson.NewObjectId()
if _, err = self.collection.Upsert(bson.M{"_id": id}, item); err != nil {
// Allocating a new ID.
if err = self.collection.Insert(bson.M{"_id": id}); err != nil {
return nil, err
}
// Now append data the user wants to append.
if err = self.collection.Update(bson.M{"_id": id}, item); err != nil {
return nil, err
}
return id, nil
/*
var id bson.ObjectId
var err error
id = bson.NewObjectId()
_, err = self.collection.Upsert(bson.M{"_id": id}, item);
if err != nil {
return nil, err
}
return id, nil
*/
}
// Returns true if the collection exists.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment