amilner42 / code-tidbit

Share Programming Knowledge Better
GNU General Public License v3.0
9 stars 1 forks source link

change MongoIDStringSchema to MongoIDSchema #170

Closed daravi closed 7 years ago

daravi commented 7 years ago

Closes

Closes #162

Description

Uses the kleen.anySchema to validate the mongoDB ObjectID. Instead of verifying the ObjectID as a 24 long string, the ObjectID.isValid method from the mongodb library is used. This allows for valid strings as well as valid ObjectID instances to be validated by the MongoIDSchema.

Deploy Instructions

This will require an npm install in backend/ because it uses the new version of kleen.