18 lines
646 B
JavaScript
18 lines
646 B
JavaScript
import PocketBase from 'pocketbase';
|
|
|
|
const pb = new PocketBase('https://iot.epi.cb85.software');
|
|
|
|
// fetch a paginated records list
|
|
const resultList = await pb.collection('users').getList(1, 50, {
|
|
filter: 'created >= "2022-01-01 00:00:00" && someField1 != someField2',
|
|
});
|
|
|
|
// you can also fetch all records at once via getFullList
|
|
const records = await pb.collection('users').getFullList(200 /* batch size */, {
|
|
sort: '-created',
|
|
});
|
|
|
|
// or fetch only the first record that matches the specified filter
|
|
const record = await pb.collection('users').getFirstListItem('someField="test"', {
|
|
expand: 'relField1,relField2.subRelField',
|
|
}); |