{"action":"opened","issue":{"url":"https://api.github.com/repos/globalsign/mgo/issues/249","repository_url":"https://api.github.com/repos/globalsign/mgo","labels_url":"https://api.github.com/repos/globalsign/mgo/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/globalsign/mgo/issues/249/comments","events_url":"https://api.github.com/repos/globalsign/mgo/issues/249/events","html_url":"https://github.com/globalsign/mgo/issues/249","id":352767436,"node_id":"MDU6SXNzdWUzNTI3Njc0MzY=","number":249,"title":"Pipe $sort problem","user":{"login":"zhangshp","id":32349962,"node_id":"MDQ6VXNlcjMyMzQ5OTYy","avatar_url":"https://avatars3.githubusercontent.com/u/32349962?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangshp","html_url":"https://github.com/zhangshp","followers_url":"https://api.github.com/users/zhangshp/followers","following_url":"https://api.github.com/users/zhangshp/following{/other_user}","gists_url":"https://api.github.com/users/zhangshp/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangshp/subscriptions","organizations_url":"https://api.github.com/users/zhangshp/orgs","repos_url":"https://api.github.com/users/zhangshp/repos","events_url":"https://api.github.com/users/zhangshp/events{/privacy}","received_events_url":"https://api.github.com/users/zhangshp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-22T01:28:26Z","updated_at":"2018-08-22T01:28:26Z","closed_at":null,"author_association":"NONE","body":"```\r\ncond := bson.M{\"$project\": bson.M{\r\n\t\t\"_id\":           1,\r\n\t\t\"name\":          1,\r\n\t\t\"desc\":          1,\r\n\t\t\"owner\":         1,\r\n\t\t\"ct\":            1,\r\n\t\t\"mt\":            1,\r\n\t\t\"memberCount\":   1,\r\n\t\t\"avatar\":        1,\r\n\t\t\"movementCount\": 1,\r\n\t\t\"activeValue\":   1,\r\n\t\t\"members\":       1,\r\n\t\t\"aaa\": bson.M{\r\n\t\t\t\"$cond\": []interface{}{\r\n\t\t\t\tbson.M{\"$eq\": []string{\"$owner\", \"18701607527\"}}, 0, 1,\r\n\t\t\t},\r\n\t\t}}}\r\n\tsort := bson.M{\"$sort\": bson.M{\"aaa\": 1, \"activeValue\": -1, \"ct\": -1}}\r\n\t//m := bson.M{\"$match\": bson.M{\"owner\": \"18701607527\"}}\r\n\tqs := []qqq{}\r\n\ts.DB(\"\").C(\"Group\").Pipe([]bson.M{cond, sort}).All(&qs)\r\n\tfmt.Println(qs[0])\r\n```\r\n\r\nsort working not accurate"}}
{"actor":{"display_login":"zhangshp"}}