// Count the number of records which match the find query
Count the number of records which match the find query
// Count the number of records which match the find query
func (find *Find) Count(ctx context.Context) (int, error) {
	count := options.Count()
	if find.skip != 0 {
		count.SetSkip(find.skip)
	}
	if find.limit != 0 {
		count.SetLimit(find.limit)
	}
	docCount, err := find.collection.CountDocuments(ctx, find.query, count)
	return int(docCount), wrapMongoError(err)
}
func ( find * Find ) Count ( ctx context . Context ) ( int , error ) { count := options . Count ( ) if find . skip != 0 { count . SetSkip ( find . skip ) } if find . limit != 0 { count . SetLimit ( find . limit ) } docCount , err := find . collection . CountDocuments ( ctx , find . query , count ) return int ( docCount ) , wrapMongoError ( err ) }
Count the number of records which match the find query
Count the number of records which match the find query