feat: 把可能用到的放在自己封装的包里

This commit is contained in:
tiglog 2023-08-13 02:16:11 +08:00
parent 567aafb140
commit 23369c49ad
2 changed files with 25 additions and 0 deletions

View File

@ -9,5 +9,14 @@ package mgodb
import "go.mongodb.org/mongo-driver/bson"
// M is an unordered representation of a BSON document.
// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159}
type M = bson.M
// A D should not be constructed with duplicate key names, as that can cause undefined server behavior.
// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}}
type D = bson.D
// An A is an ordered representation of a BSON array.
// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}}
type A = bson.A

16
gdb/mgodb/find.go Normal file
View File

@ -0,0 +1,16 @@
//
// find.go
// Copyright (C) 2023 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package mgodb
import "go.mongodb.org/mongo-driver/mongo/options"
// Find creates a new FindOptions instance.
var Find = options.Find
// FindOne creates a new FindOneOptions instance.
var FindOne = options.FindOne