service

package
v1.230621.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCollectionName

func GetCollectionName() *string

func QueryWithBson

func QueryWithBson(resource *crud.Resource, collection collection.Collection, body CollectionBody) map[string]interface{}

func Save

func Save(resource *crud.Resource, collection collection.Collection, body CollectionBody) (map[string]interface{}, error)

func Update added in v1.1.6

func Update(resource *crud.Resource, collection collection.Collection, body CollectionBody) (*mongo.UpdateResult, error)

Types

type CollectionBody

type CollectionBody struct {
	Filter    map[string]interface{} `json:"filter"`
	Body      map[string]interface{} `json:"body" `
	Sort      []crud.Sort            `json:"sort" `
	Page      commons.PagingRequest  `json:"page" `
	Aggregate string                 `json:"aggregate" `
}

type CollectionQuery

type CollectionQuery struct {
	Group      string `uri:"group" binding:"required"`
	Collection string `uri:"collection" binding:"required"`

	Func string `uri:"func"`
}

func (*CollectionQuery) GetCollectionName

func (q *CollectionQuery) GetCollectionName() *string

func (*CollectionQuery) GetDbCollection

func (query *CollectionQuery) GetDbCollection(resource *crud.Resource) *collection.Collection

func (*CollectionQuery) ToString

func (q *CollectionQuery) ToString() string

Jump to

Keyboard shortcuts

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