Creating Schema in Firebase database with NodeJS

Can we create schema in firebase db as we are used to creating in mongoose?

Firebase comes with two databases: the Realtime Database, and Cloud Firestore. Both of those are schemaless NoSQL databases. But in both cases, you can use the database's server-side security rules to control what type of data can be written to it.

For Realtime Database, see the documentation, and this classic video for an introduction. You'll specifically want to look at the .validate rules here.

For Cloud Firestore, see the documentation, and episode 6 in the Getting to know Cloud Firestore video series.


You can use an npm package "firefose". Documentation can be found here: https://www.npmjs.com/package/firefose