Hi there,
While coding, I noticed that createDocument doesn't provide product key suggestions in the data argument. According to your type definitions, it seems like it should suggest keys, but it doesn't.
Here's the code I was trying:
await databases.createDocument<Product>(
appwriteConfig.DATABASE_ID,
appwriteConfig.PRODUCTS_COLLECTION_ID,
ID.unique(),
{},
);
Here's the Product interface I'm using:
export interface Product extends Models.Document {
name: string;
description: Description;
category: Category;
brand: Brand;
images: string[];
videoUrl: string | null;
variants: Variant[];
weight: number;
averageRating: number | null;
reviewCount: number | null;
active: boolean;
featured: boolean;
returnPolicy: ReturnPolicy;
store: Store;
}
And here’s your type for createDocument:
createDocument<Document extends Models.Document>(
databaseId: string,
collectionId: string,
documentId: string,
data: Omit<Document, keyof Models.Document>,
permissions?: string[]
): Promise<Document>;
Since Product extends Models.Document, I expected data to suggest the keys for the Product type (excluding Models.Document keys), but that doesn’t happen. Could you help clarify this? Is this a type inference issue, or am I missing something?
issue i am experiencing is related to node-appwrite version ^14.1.0
Recommended threads
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...
- How do you contact support to cancel a s...
My nephew signed up with my CC without my permission and has forgotten the password to the account. I can't for the life of me get a hold of anyone at appwrite....
- I have try to use the appwrite in to the...
Invalid Origin. Register your new client (oailedjdbkhlkakmnnapoonllbnfmfij) as a new Web (Chrome Extension) platform on your project console dashboard