KinKon
KinKon
CCConvex Community
Created by KinKon on 9/14/2024 in #support-community
Advice Optimizing Search and Filters
Hi everyone, I'm working on a database project for Commonwealth case law and need some advice on optimizing my search and filter functionality. Here's my current setup and questions: 1. Overview - Approximately 5,000 legal cases - Each case has a "searchSnippet" field (first 10,000 characters of the case) - Cases also have the following fields: Jurisdiction, Year, CaseType. - Current implementation uses Full text search with searchSnippet as the search field 2. Desired Functionality: - Able to filter by jurisdiction( multiple or single jurisdictions) - Filter by year range - Combine filters and search (e.g cases in Belize and Barbados between 1990-2000 where the query is "Defamation in books" 3. Implementation Concerns - Is a searchField with ten thousand characters scalable? Or does it quickly become inefficient? - Is there a way to orchestrate a database call to achieve the desired functionality OR will I have to handle the filtering using some JavaScript OR is there some balance that your recommend Appreciate any insigihts on what might be best practice here or any alternative approaches you can suggest. Thanks for the help
1 replies
CCConvex Community
Created by KinKon on 2/17/2024 in #support-community
Querying for Specific IDs within an Array Field Using Indexes(or otherwise) in Convex
Hi all. I have an array in my schema called "associated users" which contain an array of strings.(token identifiers). Is it possible to query a document if I have a single string of one of the index's in the array?
3 replies
CCConvex Community
Created by KinKon on 2/12/2024 in #support-community
Issues accessing convex
I'm facing some trouble accessing the dashboard, which has resulted in an inability to interact with my data, execute functions, and manage files. Additionally, my applications are facing the same problems with the backend services. When I run npx convex dev, I still get the "Convex functions ready" console message. I am facing these issues in both local and deployed environments across multiple apps. Anyone else facing something similar?
7 replies
CCConvex Community
Created by KinKon on 2/7/2024 in #support-community
Querying Multiple Documents by IDs in Convex
I'm currently working on an application where I have a list of document IDs and I need to fetch their corresponding data from Convex. I am considering a few approaches and would appreciate some help on what is the best approach. 1. Is there a way to use the filter method to directly query for a set of IDs in one go, something akin to an IN clause in SQL? For example, can I pass an array of IDs to filter or use a combination of filter and or to achieve this? Or maybe with some other method? 2. If such an array-based filtering is not supported, would it be more efficient to: (a)Retrieve all documents and filter them on the client-side using JavaScript? () (b)Make separate queries for each ID? (c) Some other pattern
9 replies
CCConvex Community
Created by KinKon on 2/5/2024 in #support-community
Typescript pattern for handling URL search param as a specific ID Type
Hello everyone I'm working on a project where I use URL to manage the state of a document by storing the ID in the search params and retrieve it using nextJs's useSearchParams hook. Typescript correctly recognizes it as string by default. I plan on passing the ID to a function who's validators expect the variable to be the correct Document Id. Could anyone share the best pattern on how to properly cast or validate the search param so that it matches the expected type?
5 replies
CCConvex Community
Created by KinKon on 1/9/2024 in #support-community
What is the right approach when updating the user object for an app that integrates Clerk for auth?
Hi everyone, I am building a credit based payment system for a convex app that uses Clerk for authentication. I am considering an implementation where I import updateUser from clerk-sdk-node and call it inside an action. I am wondering if there's a better way where I can update the user object using Convex. I wanted to avoid storing users in the database because I'm not convinced it is necessary for my use case. I'm also trying to figure out where I update my JWT template's Claims config
12 replies
CCConvex Community
Created by KinKon on 12/29/2023 in #support-community
Is there a convenient way to get the updated document after using the db.patch method?
In my project the method returns undefined instead of the updated object. Maybe this is the expected behavior. The docs aren't explicit on what the method returns. Am I missing something
8 replies
CCConvex Community
Created by KinKon on 12/7/2023 in #support-community
Using Actions, Mutations, and Helpers in Convex for OpenAI Integration
No description
6 replies