Closed turingchangs closed 3 months ago
hi @turingchangs
I was trying to reproduce your issue, but it's working correctly.
Can you try to remove your node_modules folder and the lock file (yarn, npm ,...), clean the cache, and install it again? Example using Unix command line and yarn:
rm -rf node_modules yarn.lock
yarn cache clean
yarn install
If the issue persists please provide more information:
Note: I also check that ottoman@2.3.2
is the latest version and should be the one installed after using npm install ottoman
.
Tip: We're working in a CLI to provide an easier way to get started with ottoman, it's in beta version but will be stable soon. If you want to try it proceed with these commands:
npm install -g ottoman-cli
ottoman-cli generate
// follow wizard instructions
ottoman v2.3.2 BuildSchemaError: Unsupported type specified in the property 'strict'
my schema:user.js
module.exports = { options:{ scopeName: 'test', collectionName:'user' }, schema:new Schema({ id:Number, name:{type: String, required: true,}, }), };
use: model(user.options.collectionName, user.schema, user.options);
An exception occurred at this time,in lib/schema.js:BuildSchemaError: Unsupported type specified in the property 'strict';
I just called model() function once,but it was executed twice,and didn't get a value of Schema at the second time,
and I saw an update to this file (schema.js) on github,However, the code I extracted after using the command(npm install ottoman) is not the latest 2.3.2 version