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
- Projects can't be accessed
It's been like 2 weeks and I can't access my projects. After clicking any, it loads, then stops and nothing happens. No error is displayed. The projects are o...
- login is broken
even used VPN not working, searched for a reason didn't found any used email not working brave browser
- GitHub Educational user offer
Hi, I'm a GitHub educational user and am confused about how to claim the following offer "Free access to Appwrite's Education plan (2 projects with equivalent r...