node.js - Reading incomplete API docs - how do you know what all your [options] are if they are not listed? -
how go finding [options]
available when not listed out?
in case of mongoose
nodejs
: http://mongoosejs.com/docs/api.html#schema_schema-index
examples not complete. how 1 track down full extent of options
can pass in second parameter?
it reads:
schema#index(fields, [options]) defines index (most compound) schema. show code parameters: fields <object> [options] <object> example schema.index({ first: 1, last: -1 }, { unique: true })
in places, options detailed out, wonderful. example:
http://mongoosejs.com/docs/api.html#connection_connection-openset
thanks.
also, found lovely question/answer.
the obvious answer read through source code, i've found it's easier read tests. tests bits of code developer(s) cares about.
in case of schema index tests alluded several options: https://github.com/learnboost/mongoose/blob/master/test/schema.test.js#l1028
however after further digging lot of options tied specific schema type: https://github.com/learnboost/mongoose/blob/master/lib/schematype.js#l96
Comments
Post a Comment