and this below is my function in which i want nested query to get the desired result - @override
Future<List<Document>> getSavedBlogsByHashtag(
String hastag, UserModel user) async {
final documents = await _db.listDocuments(
databaseId: AppConstants.APPWRITE_DATABASE_ID,
collectionId: AppConstants.APPWRITE_BLOGS_COLLECTION,
queries: [
Query.equal('\$id', user.SavedPosts),
Query.search('hastags', hastag),
Query.orderDesc('createdAt'),
Query.limit(100),
]);
return documents.documents;
}
The last one should work
What are you getting back?
i am getting a blank screen with a laoder
but i tried printing hashtag in function
it is correct
the function is getting the hashtag
Try to print it and surround it with try catch like so and share the results
@override
Future<List<Document>> getSavedBlogsByHashtag(
String hastag, UserModel user) async {
try {
final documents = await _db.listDocuments(
databaseId: AppConstants.APPWRITE_DATABASE_ID,
collectionId: AppConstants.APPWRITE_BLOGS_COLLECTION,
queries: [
Query.equal('\$id', user.SavedPosts),
Query.search('hastags', hastag),
Query.orderDesc('createdAt'),
Query.limit(100),
]);
print(documents);
return documents.documents;
} catch (e){
print(e);
return null;
}
}
getting this - Documents: Instance of 'DocumentList'
And this
print(documents.documents);
Documents.documents: []
So
$id
alone workshashtags
alone works- Togther doesn't work ?
Yeah first two functions are working fine but not the third one
This is weird just tested it and it should work
Can you try with other hashtags?
maybe is a index issue? π€
I think in that case it should give error that hastags
is not a fulltext index
But it's worth checking is hashtags
has fulltext index on it?
If I'm not wrong from v1.3 you won't get index error
Also for fullText
?
I'm not sure to be honest
Strict indexes for queries in Appwrite 1.3 are no longer necessary! If you ever used Appwrite Databases, chances are, you have seen the error β οΈIndex Not Found. Such strict indexes can get in the way during development and can be a blocker to some use cases with complex filtering possibilities. With Appwrite 1.3, you are no longer going to get errors telling you to set up an index.
I found this from v1.3 release
π€£ I hope we don't let you full text search without index
Tha
That's not a good idea at all
Recommended threads
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...