validation

package
v0.1.9-0...-deb25a2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoSanitize

func MongoSanitize(s string) string

MongoSanitize ...

func ValidCollectionName

func ValidCollectionName(name string) bool

ValidCollectionName ...

Collection names should begin with an underscore or a letter character, and cannot:

- contain the $. - be an empty string (e.g. ""). - contain the null character. - begin with the system. prefix. (Reserved for internal use.)

see https://docs.mongodb.com/manual/reference/limits/#Restriction-on-Collection-Names

func ValidFieldName

func ValidFieldName(name string) bool

ValidFieldName ...

- Field names cannot contain the null character. - Top-level field names cannot start with the dollar sign ($) character. - Otherwise, starting in MongoDB 3.6, the server permits storage of field names that contain dots (i.e. .) and dollar signs (i.e. $). - Until support is added in the query language, the use of $ and . in field names is not recommended and is not supported by the official MongoDB drivers.

see https://docs.mongodb.com/manual/reference/limits/#Restriction-on-Field-Names

Types

This section is empty.

Jump to

Keyboard shortcuts

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