Most of the find options you can check in package options
https://github.com/mongodb/mongo-go-driver/tree/master/mongo/options
client, err := mongo.Connect(context.Background(), "mongodb://localhost:27017", nil)
// check err
db := client.Database("examples")
coll := db.Collection("inventory")
{
cursor, err := coll.Find(
context.Background(),
options.SetSort(bson.NewDocument(bson.EC.Int64("x", 1))),
options.SetLimit(30),
options.SetSkip(5),
)
// cursor decode...
}
Count with filter
count, err :=coll.Count(context.Background(),bson.NewDocument(bson.EC.String("foo", "bar")))
Count from document metadata
count, err := coll.EstimatedDocumentCount(context.Background(),countopt.MaxTimeMs(100))
Edit:
Mongo-go-driver stable v1.0.0 released where they separated the BSON library, Please refar to official documentation