Pleex
Search…
getItems
Find and get objects, this is for multiple results

getItems({key: value, ...} , (data)=> {}, (error)=> {})

How to use:

1
my_collection.getItems(
2
{key: value},
3
(data) => // data array can access here,
4
(error) => alert(error)
5
);
Copied!

Arguments:

parameter
required
types
search object
yes
object
success callback
yes
function
failure callback
yes
function

Example:

1
import React,{useEffect} from 'react';
2
import {Text} from 'react-native';
3
import {Pleex} from 'pleex';
4
5
const App = () => {
6
7
// Create collection
8
const my_collection = Pleex.collection('myCollection');
9
10
// Get all data saved
11
my_collection.getItems(
12
{ age: 12 },
13
(data) => // data array can access here,
14
(error) => alert(error)
15
);
16
17
return (
18
<>
19
<Text>Try getItems api</Text>
20
</>
21
);
22
23
};
24
25
export default App;
Copied!

Tips:

  1. 1.
    if pleex don't find anything its return [ ], empty array
Last modified 2yr ago