Is it possible and efficient) to save an entire collection in a variable and then run code on this variable instead of code on collection

Hi,

I have a database with 1000 rows and around 15 columns stored in a collection. I have a number of filters and a repeater displaying the first 12 elements based on the filter. Filtering the repeater is relatively slow (apparently a known issue with repeaters) and also some features are relatively hard to implement using both the dataset and also the collection.

So I thouhg about when the page is loading, to store the entire collection in a variable and then run the code on the varible and link it directly to the repeater. Is this possible? If yes, could you share the code to save the entire collection in a variable? I tried this, but it is not working.

let myOptions= wixData.query(“Wedding_Database”)
.limit(1000)
.then( (results) => {
results.items
} );

neither is this here:

let myOptions= wixData.query(“Wedding_Database”)

Another option would be to look into lazy loading and only load so much at one time.

You can see Nayeli (Code Queen) example for it here.
https://codequeen.wixsite.com/lazy-loading
Auto Load Content on Scroll to create Lazy Loading on Wix using Corvid