خرید بک لینک

Vote count: 0

In the back end i m using go lang and for database i use mongoDB. I m trying to find the last document inserted in the embedded array so i can retrieve the document in the last array index without knowing its index.Is is possible?? After researching on this i came to know that its not possible.So i m thinking of using $push,$each and $position.Here i can set the position to 0 so the newly added document will be in 0 so i can retreive it using the index 0. Here is my schema type ( Employee struct { EmpId string AualLeave []*AualLeaveInfo } AualLeaveInfo struct { ATotal int64
} I use the mgo statement as follows

c.Update(bson.M{"empid": "string"}, bson.M{"$push": bson.M{"aualleave":bson.M{"$each": bson.D{"atotal": 4},"$position":0}}}) please help me.Thanks..

asked 31 secs ago

برچسب: need to include strsafe h after tchar h,need to include address on resume,need to include spouse name in passport,need to include zapatec js file,need to include cover letter,need to be included,need to feel included, نویسنده: استخدام کار تاريخ: جمعه 5 شهريور 1395 ساعت: 15:16

صفحه بندی