'use strict' ; module const mongoose = require ( 'mongoose' ) ; let schema = mongoose . Schema ( { name : { type : String , index : true } , location : { type : { type : String } , coordinates : [ Number ] } } ) ; schema . index ( { location : '2dsphere' } ) ; method param filter param skip param limit param sort param select return { Promise < any > } schema . statics . list = function ( filter ? , skip ? , limit ? , sort ? , select ? ) : Promise < any > { const query = Product . find ( filter ) ; query . sort ( sort ) ; query . skip ( skip ) ; query . limit ( limit ) ; query . select ( select ) ; return query . exec ( ) ; } ; export const Product = mongoose . model ( 'Product' , schema ) ; export default Product ;