how to get “collection name” by providing “collection id” in “Stores/Collections” dataset ?
This is surely not enough INPUT to work with.
And either you use DATASET ----> OR <---- DATA-COLLECTION.
With DATASET some kind of this way…(you have to complete and to modify this code).
import wixUsers from 'wix-users';
$w. onReady(function() {
let user = wixUsers.currentUser;
let userId = user.id;
let isLoggedIn = user.loggedIn;
user.getEmail()
.then((email) => {
let userEmail = email;
});
$w("#myDataset").onReady( () => {
$w("#myDataset").getItems(0, 5)
$w("#myDataset").setFilter(wixData.filter()
.eq("_id", userId);
.then( (result) => {
let items = result.items;
let totalCount = result.totalCount;
let offset = result.offset;
console.log(items)
console.log(totalCount)
console.log(offset)
//---------------------------------
console.log(items[0].title)
console.log(items[1].title)
console.log(items[2].title)
console.log(items[3].title)
console.log(items[4].title)
})
.catch( (err) => {
let errMsg = err.message;
let errCode = err.code;
});
});
});
Take a look at this example…