mongoapi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLLATION_STRENGTH_IGNORE_DIACRITICS_AND_CASE int = iota + 1
	COLLATION_STRENGTH_IGNORE_CASE
	COLLATION_STRENGTH_DEFAULT
)

Variables

View Source
var (
	Client *mongo.Client = nil
)

Functions

func Drop

func Drop(collName string) error

func RestfulAPICount

func RestfulAPICount(collName string, filter bson.M) (int64, error)

func RestfulAPIDeleteMany

func RestfulAPIDeleteMany(collName string, filter bson.M, argOpt ...interface{}) error

func RestfulAPIDeleteOne

func RestfulAPIDeleteOne(collName string, filter bson.M, argOpt ...interface{}) error

func RestfulAPIGetMany

func RestfulAPIGetMany(collName string, filter bson.M, argOpt ...interface{}) ([]map[string]interface{}, error)

func RestfulAPIGetOne

func RestfulAPIGetOne(collName string, filter bson.M, argOpt ...interface{}) (
	result map[string]interface{}, err error,
)

func RestfulAPIJSONPatch

func RestfulAPIJSONPatch(collName string, filter bson.M, patchJSON []byte, argOpt ...interface{}) error

func RestfulAPIJSONPatchExtend

func RestfulAPIJSONPatchExtend(
	collName string, filter bson.M, patchJSON []byte, dataName string, argOpt ...interface{},
) error

func RestfulAPIMergePatch

func RestfulAPIMergePatch(
	collName string, filter bson.M, patchData map[string]interface{}, argOpt ...interface{},
) error

func RestfulAPIPost

func RestfulAPIPost(
	collName string, filter bson.M, postData map[string]interface{}, argOpt ...interface{},
) (bool, error)

func RestfulAPIPostMany

func RestfulAPIPostMany(collName string, filter bson.M, postDataArray []interface{}) error

func RestfulAPIPullOne

func RestfulAPIPullOne(collName string, filter bson.M,
	putData map[string]interface{}, argOpt ...interface{},
) error

func RestfulAPIPutMany

func RestfulAPIPutMany(
	collName string, filterArray []bson.M, putDataArray []map[string]interface{}, argOpt ...interface{},
) error

func RestfulAPIPutOne

func RestfulAPIPutOne(collName string, filter bson.M, putData map[string]interface{}, argOpt ...interface{}) (
	bool, error,
)

if no error happened, return true means data existed and false means data not existed

func RestfulAPIPutOneNotUpdate

func RestfulAPIPutOneNotUpdate(
	collName string, filter bson.M, putData map[string]interface{}, argOpt ...interface{},
) (
	bool, error,
)

if no error happened, return true means data existed (not updated) and false means data not existed

func SetMongoDB

func SetMongoDB(setdbName string, url string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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