Hello, I need to get documents from Database that start with "2024-11" but it's not returning anything.
Here current used for this query
`export async function searchLogbookByDate( query: string, // eslint-disable-next-line prettier/prettier userId: number ) { try { let queryArray; queryArray = [ Query.startsWith("date", query), Query.equal("userId", userId), ]; console.log("date query", queryArray);
queryArray as unknown as Query[];
const posts = await databases.listDocuments(
databaseId,
logbookCollectionId,
// eslint-disable-next-line prettier/prettier
queryArray as unknown as string[]
);
console.log(
query,
// eslint-disable-next-line prettier/prettier
"Posts in search logbook by date" + JSON.stringify(posts)
);
if (query === null) throw new Error("Something went wrong");
if (!posts) throw new Error("Something went wrong");
return posts.documents;
} catch (error: any) { Alert.alert("Error", error.message); } }`
Recommended threads
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...