I load data from a file
{
id: '1081',
title: "Some Prod",
type: "tap",
description: "Some Prod",
imageUrl: 'https://storage.googleapis.com/.../tooal.jpg',
price: 5.99,
quantity: "1 unit",
size: "XL",
rating: 4
}
and the code used is
return Promise.all(items.map(item => {
const { id, ...data } = item;
return db.collection(collectionName)
.doc(id)
.set(data);
}));
Now the search function, gives no results
const {id} = data;
const store = admin.firestore();
const querySnapshot = await store.collection("products")
.doc(id)
.get();
const product = querySnapshot.docs.map((doc) => ({
...doc.data(),
id: doc.id,
}));
Search from firestore is also not giving the results (0 records found for search) The only types available are Number, String, Boolean, so used string (assuming String can be ' ' or " )
How to make my search work ?