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
- edu email
my edu email is my seccondary email for github and when i signed in i dont think its registering i have an edu email using githubs education pack anyone know ho...
- Issues with Appwrite and networking
Hi, I’ve been having some real issues with hosting appwrite, I have it running with the hostname ‘localhost’ and I used to also be able to use the machines IP ...
- Appwrite usage is reporting inaccurate i...
I was using Appwrite mainly for the site hosting on the free tier when I saw that I am using 5 GB storage when Appwrite only allows you to use 2 GB. It’s been l...