Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate generate mongo filter based on the input struct The struct may have sub-struct. Field used as filter must have tags with filtering options Eg: ```
type ExampleStruct struct { Toto *int64 `mgo-filter:"toto,op:$eq,omitempty"` Titi string `mgo-filter:"titi,op:$gt"` Hello *[]string `mgo-filter:"hello,op:$in"` }
``` The op is the filtering operation applied, When the omitempty option is set, the field will be ignored when nil or containing a zero value Field name should be in the form `fieldName` or `parentFieldName.fieldName` with any amount of subfield Note that using sub-structure won't change the resulting filter.
func RegisterStruct ¶
func RegisterStruct(s interface{})
RegisterStruct register a struct in cache for quicker pagination generation when using the said struct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.