golib/gdb/mgodb/types.go

32 lines
879 B
Go
Raw Normal View History

2023-06-15 21:22:51 +08:00
//
// bson.go
// Copyright (C) 2023 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package mgodb
import (
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
2023-08-13 20:03:26 +08:00
"go.mongodb.org/mongo-driver/mongo"
)
2023-06-15 21:22:51 +08:00
// M is an unordered representation of a BSON document.
// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159}
2023-06-15 21:22:51 +08:00
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}}
2023-06-15 21:22:51 +08:00
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
2023-08-13 02:22:04 +08:00
type ObjectID = primitive.ObjectID
2023-08-13 20:03:26 +08:00
// Collection is a handle to a MongoDB collection. It is safe for concurrent use by multiple goroutines.
type Collection = mongo.Collection