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.

how read api documentation newbs?

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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -