getItems
Find and get objects, this is for multiple results
getItems({key: value, ...} , (data)=> {}, (error)=> {})
getItems({key: value, ...} , (data)=> {}, (error)=> {})
How to use:
my_collection.getItems(
{key: value},
(data) => // data array can access here,
(error) => alert(error)
);
Arguments:
parameter
required
types
search object
yes
object
success callback
yes
function
failure callback
yes
function
Example:
import React,{useEffect} from 'react';
import {Text} from 'react-native';
import {Pleex} from 'pleex';
const App = () => {
// Create collection
const my_collection = Pleex.collection('myCollection');
// Get all data saved
my_collection.getItems(
{ age: 12 },
(data) => // data array can access here,
(error) => alert(error)
);
return (
<>
<Text>Try getItems api</Text>
</>
);
};
export default App;
Tips:
if pleex don't find anything its return [ ], empty array
Last updated
Was this helpful?