You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mgo-...@googlegroups.com
hello,
could you please show me the example of new Bulk interface? i'm trying this one
docs := make([]interface{}, len(myarr))
for i := 0; i < len(myarr); i++ {
docs[i] = mystruct{myarr[i]}
}
......................
t.Bulk().Insert(docs...)
res, err := t.Bulk().Run()
but it returns error - "Client Error: Remaining data too small for BSON object"
S.
unread,
Oct 11, 2014, 1:25:56 PM10/11/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mgo-...@googlegroups.com
well, I guess I gound the answer, the code should be shomething like that:
x := t.Bulk()
x.Insert(docs...)
res, err := x.Run()
but, I was hoping it will Insert documents no matter if the will be duplicated documents with unique index (just dropping it). Instead, it have same behaviour as usual mgo.Insert(docs...) - no inserts and return the same error. How could I make mgo to bulk insert only unique documents and drop duplicates?
S.
unread,
Oct 11, 2014, 2:42:00 PM10/11/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message