1

I'm developing a React Native app using Mobile SDK and I'm having trouble joining two soups together with SmartSync. I have already registered them with success, but I can not figure out how to join them.

This is how i register the two soups "contacts" and "departments":

smartstore.registerSoup(
    false,
    "contacts",
    [
        { path: "Id", type: "string" },
        { path: "First_Name", type: "full_text" },
        { path: "Last_Name", type: "full_text" },
        { path: "Department_Name", type: "full_text" },
    ],
    () => syncDown()
);
smartstore.registerSoup(
    false,
    "departments",
    [
        { path: "Id", type: "string" },
        { path: "Name", type: "full_text" },
    ],
    () => syncDown()
);

This is from the sync down function, where I sync down from the soup "contacts":

const fieldlist = ["Id", "First_Name", "Last_Name"];
const target = {
             type: "soql",
             query: `SELECT ${fieldlist.join(",")} FROM Contacts'`
            };

            smartsync.syncDown(
                    false,
                    target,
                    "contacts",
                    { mergeMode: smartsync.MERGE_MODE.OVERWRITE },
                    syncName,
                    sync => {
                        syncInFlight = false;
                        console.log(`sync==>${sync}`);
                        emitSmartStoreChanged();
                        if (callback) callback(sync);
                    },
                    error => {
                        syncInFlight = false;
                    }
                );

But how can I join two soups together first and then sync down?

  • Have you ever figured this out? facing the same here – zaitsman Feb 6 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.