#Set default values for insertion

59 messages · Page 1 of 1 (latest)

heady oriole
#

Is it possible to set default values at the table level, so that by default, values would get applied without having to remember to pass it in to whatever method is creating the document?


  /* todo - implement collections */
  collections: defineTable({
    /** id of the user who created the collection */
    userId: v.id('users'),
    /** name of the collection - i.e. "Wishlist" */
    name: v.string(),
    /** description of the collection */
    description: v.optional(v.string()),
    /** optional privacy setting for the collection */
    privacy: v.union(v.literal('PUBLIC'), v.literal('PRIVATE')).default('PUBLIC'),
  }).index('by_userId', ['userId']),

the privacy would take the literal string it could be, and be defaulted to PUBLIC in this instance

sharp ruinBOT
#

Hi @heady oriole. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Convex's built-in schema validation does not currently support setting default values at the table/schema level (e.g., via a .default() method on a validator). This means you cannot define a default value for a field directly in your defineTable schema such that it is automatically applied on insertion if the value is missing.

The recommended approach is to make the field optional in your schema using v.optional(...), and then ensure that your application logic (e.g., in your mutation or action functions) sets the default value when inserting documents. For example:

collections: defineTable({
  userId: v.id('users'),
  name: v.string(),
  description: v.optional(v.string()),
  privacy: v.optional(v.union(v.literal('PUBLIC'), v.literal('PRIVATE'))),
}).index('by_userId', ['userId']),

Then, in your mutation:

await ctx.db.insert("collections", {
  userId,
  name,
  description,
  privacy: privacy ?? "PUBLIC", // Set default if not provided
});

Alternatively, you can use a migration to backfill a default value for existing documents, and then later make the field required in your schema once all documents have the value set. This is a common pattern in Convex migrations and schema evolution workflows see example.

If you want stricter type safety and default value enforcement, you might consider using Convex Ents, which allows you to specify default values at the schema level. However, this is not part of the core Convex schema API and requires using the Ents library.

#

Summary:

  • You cannot set a default value at the table/schema level with Convex's built-in schema.
  • Make the field optional and set the default in your code, or use a migration to backfill.
  • For true schema-level defaults, consider Convex Ents, but this is not standard Convex.

Reference: Stack Convex Ents: Default field values
Reference: Convex Migrations - Common use cases
Reference: Convex Database Schemas - Validators

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

how would i use Convex Ents here to get what I desire @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

To achieve default values at the schema level using Convex Ents, you can use the .field() method with a default option. This allows you to specify a default value for a field, so that when you create a new document and omit that field, the default will be automatically applied.

Here’s how you would define your collections table with a default value for privacy using Convex Ents:

import { defineEnt } from "convex-ents";
import { v } from "convex/values";

const collections = defineEnt({
  userId: v.id("users"),
  name: v.string(),
  description: v.optional(v.string()),
})
  .field(
    "privacy",
    v.union(v.literal("PUBLIC"), v.literal("PRIVATE")),
    { default: "PUBLIC" }
  );

With this setup, whenever you create a new collection and do not specify the privacy field, it will default to "PUBLIC" automatically. This is not possible with vanilla Convex schemas, but is supported by Convex Ents as described in the documentation:

If the default value is just a simple value like in this example, you can achieve this more easily with Convex Ents:

posts: defineEnt({
  // ... other fields
})
  .field(
    "contentType",
    v.union(v.literal("text"), v.literal("video")),
    { default: "text" }
  )

Since contentType is not an optional field in the document type, TypeScript can ensure that you’re always providing it when writing to the database.

Source: Stack Convex Ents: Default field values

#

Note: Convex Ents is a community-maintained library and is in maintenance mode, so be sure to review its documentation and stability for your use case Stack Convex Ents.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

is using Ents better for performance? @sharp ruin

should i be using ents for my collections & user collections?

Introduce using this new feature with Ents if its better for relationships than vanilla convex

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Using Convex Ents is not inherently better for performance compared to vanilla Convex. Ents is a higher-level abstraction built on top of Convex’s core primitives. It provides a more ergonomic and expressive API for modeling relationships, setting default values, enforcing uniqueness, and handling cascading deletes, but it does not introduce new performance optimizations at the database level. All operations performed by Ents are ultimately translated into standard Convex queries and mutations, so the underlying performance characteristics remain the same Convex Ents: Conclusion.

When should you use Ents?

  • If you want to simplify your code for managing relationships (like collections and user collections), Ents can save boilerplate and make your intent clearer, especially for complex relationships such as many-to-many or cascading deletes.
  • Ents makes it easier to set default values, enforce unique fields, and traverse relationships with a more fluent API Convex Ents: Manage your document relationships.
  • However, Ents is in maintenance mode, meaning it is stable but not actively developed with new features by the Convex team. You should be comfortable with this tradeoff and aware that future migrations may be needed if Convex introduces similar features natively Discord: Ents is in maintenance mode.

Summary:

  • Performance: No significant difference; both use the same underlying Convex primitives.
  • Ergonomics: Ents is better for modeling and querying relationships, setting defaults, and reducing boilerplate.
  • Stability: Ents is stable but not actively developed; consider your project’s needs and future migration effort.
#

If your main goal is to make relationship management and schema evolution easier and more expressive, Ents is a good fit. If you want to minimize dependencies and stick to the most stable, core-supported features, vanilla Convex is the way to go.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

how could we incorporate my userCards and userCollections table using the ents and edges, compared to how i have it now with the vanilla convex v.id() @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

To model your userCards and userCollections tables using Convex Ents and edges, you would define your entities (users, cards, collections) and then use .edges() to declare the relationships between them. This is more expressive and concise than manually managing v.id() references and indexes in vanilla Convex.

Example: Vanilla Convex

With vanilla Convex, you might have something like:

users: defineTable({
  name: v.string(),
}),
cards: defineTable({
  title: v.string(),
}),
userCards: defineTable({
  userId: v.id("users"),
  cardId: v.id("cards"),
}),
collections: defineTable({
  userId: v.id("users"),
  name: v.string(),
}),
userCollections: defineTable({
  userId: v.id("users"),
  collectionId: v.id("collections"),
}),

You would then use queries and manual joins to relate users to cards and collections.


Example: Convex Ents

With Convex Ents, you can define these relationships more declaratively:

import { defineEnt } from "convex-ents";
import { v } from "convex/values";

const users = defineEnt({
  name: v.string(),
})
  .edges("cards")
  .edges("collections");

const cards = defineEnt({
  title: v.string(),
})
  .edges("users");

const collections = defineEnt({
  name: v.string(),
})
  .edges("users");
  • .edges("cards") on users means a user can have many cards.
  • .edges("users") on cards means a card can belong to many users (many-to-many).
  • Similarly for collections and users.

This approach automatically sets up the join tables and indexes for you, and you can traverse relationships easily in your queries:

// Get all cards for a user
const userCards = await ctx.table("users").getX(userId).edge("cards");

// Get all collections for a user
const userCollections = await ctx.table("users").getX(userId).edge("collections");
#

This is much more concise and less error-prone than manually handling IDs and indexes. Ents also provides helpers for traversing and managing these relationships, making your codebase easier to maintain and reason about Convex Ents: Many to many relationships.

Note: Ents is in maintenance mode, so consider your project's needs before adopting it Convex Ents: Conclusion.


Summary:

  • With vanilla Convex, you manually manage foreign keys and indexes.
  • With Ents, you declare relationships with .edges(), and get a more expressive, concise API for traversing and managing relationships.
  • Ents is especially helpful for many-to-many relationships like userCards and userCollections Convex Ents: Many to many relationships.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

okay so looking at this:

const collections = defineEnt({
  /** id of the user who created the collection */
  userId: v.id('users'),
  /** name of the collection - i.e. "Wishlist" */
  name: v.string(),
  /** description of the collection */
  description: v.optional(v.string()),
})
  .field('privacy', v.union(v.literal('PUBLIC'), v.literal('PRIVATE')), {
    default: 'PUBLIC',
  })
  .edge('users');

const userCards = defineEnt({
  /** id of the collection (if it is part of a collection) */
  collectionId: v.optional(v.id('collections')),
  /** id of the card */
  cardId: v.id('pokemonCards'),
  /** id of the user who added the card to the collection */
  userId: v.id('users'),
  /** optional notes about the card in this collection */
  notes: v.optional(v.string()),
  /** optional price paid for the card */
  pricePaidInCents: v.optional(v.number()),
  /** optional date of purchase/added to collection */
  dateAdded: v.optional(v.string()),
})
  .field(
    'condition',
    v.union(
      v.literal('NM'),
      v.literal('LP'),
      v.literal('MP'),
      v.literal('HP'),
      v.literal('POOR'),
      v.literal('N/A')
    ),
    { default: 'N/A' }
  )
  .field('quantity', v.number(), { default: 1 })
  .edges('users')
  .edges('userCollections');

is this setup right to use with convex ents? Also, how do you handle edges that could be optional, as userCards may or may not be associated with a userCollection @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Your setup is close, but there are a few important clarifications and improvements based on the Convex Ents documentation:

1. Defining Edges in Convex Ents

  • In Convex Ents, you use .edge() for a single relationship (1:1 or many:1) and .edges() for a 1:many or many:many relationship.
  • The .edge() and .edges() methods are used to declare relationships, but the actual field storing the foreign key is still defined in the object passed to defineEnt. The edge declaration is for relationship traversal and API ergonomics, not for schema enforcement.

2. Optional Edges

  • If a relationship is optional (e.g., a userCard may or may not belong to a userCollection), you should make the foreign key field optional in the schema using v.optional(...).
  • The .edge() or .edges() declaration does not make the relationship required or optional; it just enables the traversal API.

3. Example Based on Your Schema

Here’s how you could define your entities with Convex Ents, including an optional edge:

import { defineEnt } from "convex-ents";
import { v } from "convex/values";

const collections = defineEnt({
  userId: v.id("users"),
  name: v.string(),
  description: v.optional(v.string()),
})
  .field("privacy", v.union(v.literal("PUBLIC"), v.literal("PRIVATE")), { default: "PUBLIC" })
  .edges("userCards"); // A collection can have many userCards
#

const userCards = defineEnt({
collectionId: v.optional(v.id("collections")), // Optional relationship
cardId: v.id("pokemonCards"),
userId: v.id("users"),
notes: v.optional(v.string()),
pricePaidInCents: v.optional(v.number()),
dateAdded: v.optional(v.string()),
})
.field(
"condition",
v.union(
v.literal("NM"),
v.literal("LP"),
v.literal("MP"),
v.literal("HP"),
v.literal("POOR"),
v.literal("N/A")
),
{ default: "N/A" }
)
.field("quantity", v.number(), { default: 1 })
.edge("collections") // Each userCard can belong to a collection (optional)
.edge("users"); // Each userCard belongs to a user

// If you have a userCollections table, define it similarly, using v.optional for optional relationships.


### 4. **How to Handle Optional Edges**

- Make the foreign key field optional in the schema (e.g., `collectionId: v.optional(v.id("collections"))`).
- Declare the edge with `.edge("collections")` or `.edges("collections")` as appropriate.
- When creating a `userCard`, you can omit `collectionId` if it is not associated with a collection.

### 5. **Reference**

This approach is consistent with the Convex Ents documentation, which shows that you should use `v.optional` for optional relationships and use `.edge()`/`.edges()` for relationship traversal and API ergonomics [Convex Ents: Simpler ways to model and query related documents](<https://stack.convex.dev/ents>) [Convex Ents: Many to many relationships](<https://stack.convex.dev/ents#many-to-many-relationships>).

---
#

Summary:

  • Your use of .field() for defaults and v.optional for optional relationships is correct.
  • Use .edge()/.edges() for relationship traversal, but always make the foreign key field optional in the schema if the relationship is not required.
  • This setup is supported and idiomatic for Convex Ents.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

Alright so looking what i have now, do i still need to provide the .index() off an convex ent table? Does the setup look correct for the new tables that use the convex ent helper @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

With Convex Ents, you do not need to manually define .index() on your tables for the fields used in edges or relationships. Convex Ents automatically manages the necessary indexes for you when you declare edges between entities. This is one of the main benefits of using Ents—it reduces boilerplate and ensures that your relationship queries are efficient without extra manual setup.

From the documentation:

The message ents are declared to have a unique edge to the users table. This translates to the exact same code you saw above: a userId field, and an associated index. ... This information doesn’t affect the Convex schema, but it allows you to query the relevant messages “from” the user ent.
Convex Ents: Manage your document relationships

So, your setup for the new tables using Convex Ents looks correct, and you do not need to add .index() for the edge fields—Ents handles this for you.

If you need custom indexes for other queries (not related to edges), you can still define them, but for relationships managed by Ents, manual index creation is unnecessary.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

so with this Ent:


const userCardsEnt = defineEnt({
  /** id of the collection (if it is part of a collection) */
  collectionId: v.optional(v.id('collections')),
  /** id of the card */
  cardId: v.id('pokemonCards'),
  /** id of the user who added the card to the collection */
  userId: v.id('users'),
  /** optional notes about the card in this collection */
  notes: v.optional(v.string()),
  /** optional price paid for the card */
  pricePaidInCents: v.optional(v.number()),
  /** optional date of purchase/added to collection */
  dateAdded: v.optional(v.string()),
})
  .field(
    'condition',
    v.union(
      v.literal('NM'),
      v.literal('LP'),
      v.literal('MP'),
      v.literal('HP'),
      v.literal('POOR'),
      v.literal('N/A')
    ),
    { default: 'N/A' }
  )
  .field('quantity', v.number(), { default: 1 })
  .edge('pokemonCards') // 1:1
  .edge('users') // 1:1
  .edges('userCollections'); // 1:many

----

  userCards: userCardsEnt
    .index('by_userId_cardId', ['userId', 'cardId']) // to know all cards a user has
    .index('by_collectionId', ['collectionId']),

I no longer need the indexes im manually attaching during the defineSchema ? even tho i have the compound index of userid and cardid, the .edge('pokemonCards').edge('users') handle that for me? @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

With Convex Ents, you do not need to manually define indexes for fields used in edges—Ents automatically creates the necessary indexes for you when you declare relationships using .edge() or .edges(). This means that for relationships like .edge('pokemonCards') and .edge('users'), Ents will handle the required indexes behind the scenes, so you don't need to add them manually in your schema Convex Ents: Manage your document relationships.

However, if you need custom or compound indexes for queries that are not directly related to the edges (for example, a compound index on userId and cardId for a specific query pattern), you may still define those manually. Ents does not automatically create all possible compound indexes—only those needed for the declared edges and their traversal.

So, in your example:

  • The indexes needed for .edge('pokemonCards') and .edge('users') are handled by Ents.
  • If you have a specific use case for the compound index by_userId_cardId, and it is not covered by the default edge indexes, you can still define it manually.

Summary:

  • Edge fields: No need to manually add indexes; Ents does it for you.
  • Custom/compound indexes: Add manually if you need them for non-edge queries.

This is confirmed in the documentation:

"The message ents are declared to have a unique edge to the users table. This translates to the exact same code you saw above: a userId field, and an associated index. ... This information doesn’t affect the Convex schema, but it allows you to query the relevant messages 'from' the user ent."
Convex Ents: Manage your document relationships


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#
import { Infer, v } from 'convex/values';

import { QueryCtx } from '../../../_generated/server';
import { PaginationOptions } from '../../../utils/convex.types';

export const GetUserCardsQueryArgs = v.object({
  userId: v.id('users'),
  pagination: PaginationOptions,
});

export const getUserCardsHandler = async (
  ctx: QueryCtx,
  args: Infer<typeof GetUserCardsQueryArgs>
) => {
  const query = ctx.db
    .query('userCards')
    .withIndex('by_userId_cardId', (q) => q.eq('userId', args.userId))
    .order('desc');

  const paginatedUserCards = await query.paginate(args.pagination);

  return paginatedUserCards;
};

before ents, this was how i was doing it in vanilla convex, does adding the edges now remove the need for the compound index i had & can remove the indexes all together? @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

With Convex Ents, you do not need to manually define indexes for fields used in edges—Ents automatically creates the necessary indexes for you when you declare relationships using .edge() or .edges(). This means that if your queries are based on traversing these relationships (for example, getting all cards for a user via an edge), Ents will handle the required indexes behind the scenes Convex Ents: Manage your document relationships.

However, if you have a custom query pattern that requires a specific compound index (like by_userId_cardId), and this pattern is not directly covered by the default edge traversal, you may still want to define that index manually. Ents does not automatically create all possible compound indexes—only those needed for the declared edges and their traversal.

So, if you switch your code to use Ents and its edge traversal API (e.g., ctx.table("users").getX(userId).edge("userCards")), you can remove the manual index. But if you still need to query by both userId and cardId together for a specific use case, you should keep the compound index.

Summary:

  • If you use Ents edge traversal: You can remove the manual index for the edge field.
  • If you need custom compound queries: Keep the manual index for those specific cases.

This approach is supported by the documentation, which states that Ents handles indexes for edges, but custom indexes may still be needed for other query patterns Convex Ents: Manage your document relationships.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#
import { Infer, v } from 'convex/values';

import { QueryCtx } from '../../../_generated/server';
import { PaginationOptions } from '../../../utils/convex.types';

export const GetUserCardsQueryArgs = v.object({
  userId: v.id('users'),
  pagination: PaginationOptions,
});

export const getUserCardsHandler = async (
  ctx: QueryCtx,
  args: Infer<typeof GetUserCardsQueryArgs>
) => {
  const query = ctx.table("users").getX(args.userId).edge("userCards")

  const paginatedUserCards = await query.paginate(args.pagination);

  return paginatedUserCards;
};

getting typescript error of:
Property 'table' does not exist on type 'QueryCtx'. (ts 2339)

@sharp ruin

#

@sharp ruin can you see my last message? please respond

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Yes, I can see your last message and the code you posted. If you have any follow-up questions or need clarification about using Convex Ents, edge relationships, or index management in your query, please let me know!

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#
import { Infer, v } from 'convex/values';

import { QueryCtx } from '../../../_generated/server';
import { PaginationOptions } from '../../../utils/convex.types';

export const GetUserCardsQueryArgs = v.object({
  userId: v.id('users'),
  pagination: PaginationOptions,
});

export const getUserCardsHandler = async (
  ctx: QueryCtx,
  args: Infer<typeof GetUserCardsQueryArgs>
) => {
  const query = ctx.table("users").getX(args.userId).edge("userCards")

  const paginatedUserCards = await query.paginate(args.pagination);

  return paginatedUserCards;
};

getting typescript error of:
Property 'table' does not exist on type 'QueryCtx'. (ts 2339)

@sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

The TypeScript error Property 'table' does not exist on type 'QueryCtx'. (ts 2339) occurs because the standard Convex QueryCtx does not include a table method. The table method is provided by the Convex Ents library, not by vanilla Convex.

To use .table() in your query handler, you need to ensure that:

  1. You are using the Convex Ents context, not the standard Convex QueryCtx.
  2. Your function is set up to use the Ents context, which is typically available as the first argument in Ents-based query/mutation handlers.

What to do:

  • If you want to use Ents features like .table(), you must use the Ents context, not the standard Convex context.
  • If you are using vanilla Convex, you should use ctx.db.query(...) as before.

Documentation reference:

Ents have one trick up their sleeve though: all methods are await-able. ... Instead of ctx.db.query we use ctx.table.
Convex Ents: Manage your document relationships

Summary:

  • The error is because QueryCtx does not have .table().
  • Use the Ents context if you want to use .table().
  • If you are not using Ents, stick with ctx.db.query.

If you need more details on how to set up and use the Ents context in your Convex functions, the knowledge sources do not provide explicit code for this, so you may need to refer to the Convex Ents documentation for integration steps.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

where do i import the correct context type then instead of using the QueryCtx from the generated server file? @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

I'm sorry, but the knowledge sources provided do not specify the exact import path or type name for the Ents context to use with the .table() method. The documentation and Discord threads confirm that .table() is part of the Convex Ents API and not available on the standard QueryCtx, but they do not show the precise import statement or type definition for the Ents context.

If you need to use .table(), you should refer to the Convex Ents documentation or the package's TypeScript definitions for the correct context type and import path. The official Convex documentation and the provided knowledge sources do not include this detail.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
#

can you add an edge on users that comes from authTables from convex auth? @sharp ruin

sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

You can customize the users table that comes from authTables in Convex Auth by inlining its definition into your schema and then extending it with additional fields or indexes, including those needed for relationships (such as edges for use with Convex Ents or your own relationship modeling).

From the documentation:

You can define a custom schema for the users table. This is helpful when your sign up form includes additional fields, or when you want to store additional user information from an OAuth provider.

To define a custom schema, inline the table definition from the library into your schema:

import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
import { authTables } from "@convex-dev/auth/server";

const schema = defineSchema({
  ...authTables,
  users: defineTable({
    name: v.optional(v.string()),
    image: v.optional(v.string()),
    email: v.optional(v.string()),
    // other "users" fields...
  }).index("email", ["email"]),
  // Your other tables...
});

Customizing Schema

This means you can add any additional fields or indexes you need, including those required for edges or relationships. However, the knowledge sources do not provide explicit examples of using Convex Ents .edge() or .edges() directly on the users table from authTables. If you want to use Ents-style relationships, you would need to inline and extend the users table as shown above, and then add the necessary fields and relationship declarations.

#

Summary:

  • You can extend the users table from authTables by inlining and customizing it in your schema.
  • You can add fields and indexes needed for relationships.
  • The knowledge sources do not explicitly show using Convex Ents .edge() on the users table, but schema extension is supported.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@heady oriole Kapa.ai is still learning and improving, please let me know how I did by reacting below.

heady oriole
sharp ruinBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

I'm sorry, but the knowledge sources provided do not contain explicit information or examples about using Convex Ents with actions or internalAction. The available documentation and examples focus on using Ents with queries and mutations, and do not detail how to integrate Ents with actions or internal actions.

If you need to use Ents within actions or internal actions, you may need to consult the official Convex Ents documentation or community resources for guidance, as this is not covered in the knowledge sources above.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: