Answer the question
In order to leave comments, you need to log in
How to request a specific element from an array?
Through graphql or better even mongoose, can you take a certain array element from the field so that this array is not downloaded to the server from the database? In my field it is stored in an array, in the array there are objects each with 10 thousand characters (these are translation options into different languages), and I think how it is possible to extract not the entire array, but only one of its elements so that the entire array is not requested. Is it possible to do this with mongoose? (there is a select, but it seems to be asking for the entire field)
The server requests from the database, but it requests the entire field, and there, let's say an array of 12 objects, each object of 10 thousand characters. Therefore, I need to somehow request a specific 1 element from this array
Answer the question
In order to leave comments, you need to log in
elemMatch
does it natively
for mongoose, you can see an example here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question