chore(docs): Generated References (automated) (#9419)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
This commit is contained in:
1 parent
e73e95f5e9
commit
34eebb61eb
585 files changed
+1248
-984
No files matched your search
+1
-1
@@ -15,7 +15,7 @@ For example, if a store is deleted, its product should also be deleted.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const Store = model.define("store", {
|
||||
id: model.id(),
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ and have conditions.
|
||||
An example of a simple index:
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
id: model.id(),
|
||||
@@ -33,7 +33,7 @@ export default MyCustom
|
||||
To add a condition on the index, use the `where` option:
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
id: model.id(),
|
||||
@@ -54,7 +54,7 @@ export default MyCustom
|
||||
The condition can also be a negation. For example:
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
id: model.id(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines the default value of a property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
color: model
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines an index on a property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
id: model.id(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method indicates that a property's value can be `null`.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
price: model.bigNumber().nullable(),
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ A unique index is created on the property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const User = model.define("user", {
|
||||
email: model.text().unique(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines an array of strings property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
names: model.array(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a number property that expects large numbers, such as prices
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
price: model.bigNumber(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a boolean property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
hasAccount: model.boolean(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a timestamp property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
date_of_birth: model.dateTime(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a property whose value can only be one of the specified valu
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
color: model.enum(["black", "white"]),
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ primary key.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const User = model.define("User", {
|
||||
id: model.id().primaryKey(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a property whose value is a stringified JSON object.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
metadata: model.json(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a number property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
age: model.number(),
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ This method defines a string property.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
name: model.text(),
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ For example, a store "hasMany" products.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const Store = model.define("store", {
|
||||
id: model.id(),
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ the other data model.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const User = model.define("user", {
|
||||
id: model.id(),
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ is associated with many orders.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const Order = model.define("order", {
|
||||
id: model.id(),
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ This method defines a data model.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
id: model.id(),
|
||||
|
||||
Reference in new issue
Block a user