schema

package
v0.0.0-...-2f69930 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Profile = bson.M{
		"name":  "profile",
		"index": []mongo.IndexModel{},
	}
)
View Source
var (
	Token = bson.M{
		"name": "token",
		"index": []mongo.IndexModel{
			{
				bson.D{
					{"userid", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"type", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"sign_info.location", "2dsphere"},
				},
				options.Index(),
			},
			{
				bson.D{
					{"expired_time", 1},
				},
				options.Index().SetExpireAfterSeconds(1),
			},
		},
	}
)
View Source
var (
	User = bson.M{
		"name": "user",
		"index": []mongo.IndexModel{
			{
				bson.D{
					{"name", 1},
				},
				options.Index().SetUnique(true),
			},
			{
				bson.D{
					{"name", 1},
					{"password", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"_id", 1},
					{"secure_password", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"extension_id", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"guest", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"level", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"roles.role", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"roles.level", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"roles.start_time", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"roles.end_time", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"_id", 1},
					{"roles.role", 1},
				},
				options.Index().SetUnique(true).SetPartialFilterExpression(bson.D{
					{"roles.role", bson.D{
						{"$exists", true},
					}},
				}),
			},
			{
				bson.D{
					{"tags.tag", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"tags.level", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"tags.start_time", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"tags.end_time", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"_id", 1},
					{"tags.tag", 1},
				},
				options.Index().SetUnique(true).SetPartialFilterExpression(bson.D{
					{"tags.tag", bson.D{
						{"$exists", true},
					}},
				}),
			},
			{
				bson.D{
					{"online.online", 1},
				},
				options.Index(),
			},
			{
				bson.D{
					{"online.location", "2dsphere"},
				},
				options.Index(),
			},
			{
				bson.D{
					{"location", "2dsphere"},
				},
				options.Index(),
			},
			{
				bson.D{
					{"enable", 1},
					{"delete", 1},
				},
				options.Index(),
			},
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL