Search
Preparing search index...
The search index is not available
DefinitelyTyped
Inherited
Private
Externals
Only exported
mongoose
Schema
Class Schema
Index
Constructor methods
constructor
Properties
Types
Methods
add
eachPath
get
index
indexes
method
path
pathType
plugin
post
pre
requiredPaths
set
static
virtual
virtualpath
Constructor methods
constructor
(
schema
?:
Object
, options
?:
Object
)
:
Schema
Parameters
schema?:
Object
optional
options?:
Object
optional
Returns
Schema
Properties
public
static
Types
:
{ String: String; ObjectId: "mongoose".Types.ObjectId; OId: "mongoose".Types.ObjectId; Mixed: any; }
public
Types.Mixed
:
any
public
Types.OId
:
ObjectId
public
Types.ObjectId
:
ObjectId
public
Types.String
:
String
Methods
public
add
(
obj
:
Object
, prefix
?:
string
)
Parameters
obj:
Object
prefix?:
string
optional
public
eachPath
(
fn
:
(path: string, type: any) => void
)
:
Schema
Parameters
fn:
(path: string, type: any) => void
Returns
Schema
public
get
(
key
:
string
)
:
any
Parameters
key:
string
Returns
any
public
index
(
fields
:
Object
, options
?:
Object
)
:
Schema
Parameters
fields:
Object
options?:
Object
optional
Returns
Schema
public
indexes
(
)
public
method
(
name
:
string
, fn
:
Function
)
:
Schema
Parameters
name:
string
fn:
Function
Returns
Schema
public
method
(
method
:
Object
)
:
Schema
Parameters
method:
Object
Returns
Schema
public
path
(
path
:
string
)
:
any
Parameters
path:
string
Returns
any
public
path
(
path
:
string
, constructor
:
any
)
:
Schema
Parameters
path:
string
constructor:
any
Returns
Schema
public
pathType
(
path
:
string
)
:
string
Parameters
path:
string
Returns
string
public
plugin
(
plugin
:
(schema: "mongoose".Schema, options?: Object) => void
, options
?:
Object
)
:
Schema
Parameters
plugin:
(schema: "mongoose".Schema, options?: Object) => void
options?:
Object
optional
Returns
Schema
public
post
(
method
:
string
, fn
:
Function
)
:
Schema
Parameters
method:
string
fn:
Function
Returns
Schema
public
pre
(
method
:
string
, callback
:
Function
)
:
Schema
Parameters
method:
string
callback:
Function
Returns
Schema
public
requiredPaths
(
)
:
Array<string>
Returns
Array<string>
public
set
(
key
:
string
, value
:
any
)
Parameters
key:
string
value:
any
public
static
(
name
:
string
, fn
:
Function
)
:
Schema
Parameters
name:
string
fn:
Function
Returns
Schema
public
virtual
(
name
:
string
, options
?:
Object
)
:
VirtualType
Parameters
name:
string
options?:
Object
optional
Returns
VirtualType
public
virtualpath
(
name
:
string
)
:
VirtualType
Parameters
name:
string
Returns
VirtualType
Globals
NodeJS
assert
buffer
child_process
cluster
crypto
dgram
dns
domain
events
fs
http
https
mongoose
mongoose.Types
net
os
path
punycode
querystring
readline
repl
stream
string_decoder
tls
tty
url
util
vm
zlib
connection
mongo
mquery
version
Collection
Connection
ConnectionOption
ConnectionSetOption
Document
FindAndUpdateOption
GeoSearchOption
MapReduceOption
MapReduceOption2
MapReduceResult
Model
PopulateOption
QueryStream
SchemaOption
Aggregate
Mongoose
Promise
Query
Schema
constructor
Types
add
eachPath
get
index
indexes
method
path
pathType
plugin
post
pre
requiredPaths
set
static
virtual
virtualpath
SchemaType
VirtualType
connect
createConnection
disconnect
get
model
modelNames
plugin
set