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
- Collection vs Document
I'm confused about the structure of Databases. We have `Database -> Collection -> Document -> Attributes`. This somehow seems to be one layer too much. I want...
- Can't delete document with permissions
A simple scenario: 1. I have 2 collections with a 1 way relationship. "screens" -> "configs" 2. The relationship is configured to set NULL on delete. 3. From a...
- Magic URL with Deep Link URI in Flutter ...
I have a Flutter app for Mac with a `myapp://test` custom URI. If I visit that URI in my web browser, it redirects to my app. But when I try to create a magic ...