gstore-node
Search…
v7.x
Introduction
Getting Started
Schema
Model
Creation
Methods
Entity
Queries
Populate
Middleware (hooks)
Cache / Dataloader
gstore Methods
Typescript
Appendix
Powered By
GitBook
Creation
Once you have defined your schema, you can create a model calling
gstore.model(<EntityKind>, <schema>)
As you can see, the name of the model will be the entity kind in the Datastore.
Example:
const
{
instances
}
=
require
(
'gstore-node'
);
const
gstore
=
instances
.
get
(
'default'
);
const
Schema
=
gstore
.
Schema
;
const
userSchema
=
new
Schema
({
name
:
{},
lastname
:
{},
email
:
{}
});
// Create the "User" model
const
User
=
gstore
.
model
(
'User'
,
userSchema
);
Previous
Model
Next
Methods
Last modified
3yr ago
Copy link