React native realm mongodb query and offline usage

We have a use case where user login will has list of products which can be shown even if not internet connection and i tried to achieve this using realm device sync (Flexible) using mongodb query (Aggregation) but it able to fetch products only when internet is available so my question is that is it possible with realm device sync that we sync products from mongodb using mongodb query and load even if there is no internet connection?

Below is sample code that i tried to integrate in our app

const config = {
}; = new Realm.App(config);

const credentials = Realm.Credentials.anonymous();

this.connection =  await{
	schema: [Customer],
	sync: {
		flexible: true,
		onError: (_session, error: any) => {
			console.log('sync error');
			console.log(, error.message);

const mongodb ='mongodb-atlas');
const collectionUsers = mongodb.db('dev_database').collection('user_roles');

const pipeline = [{

const result = await collectionUsers.aggregate(pipeline);
// Get result when user is online but do not loads after i switch to offline