I used SQL engines and some noSQL engines, as well as indexdb, and it could clear data across multiple tables without specifying foreign keys or anything else.
My question is: is it possible to make a query to clear data on object tables in Realm without defining any special relationships in the structure? To express myself better, I'm going to post code samples of what I want to achieve with Realm so you can help me.
Implementation using dexie, indexdb wrappers
db.quote_items.where('quote_id').equals(quote_id).then(function(a){ db.products.where('id').equals(quote_id.product_id).then(function(){ list.push({'id': a.id, 'product_name':a.product_name, 'product_code': a.product_code, 'quantity':a.quantity, 'tax':a.tax, 'unit_price':a.unit_price, 'val_tax':a.val_tax, 'discount_val':a.discount_val, 'gross_total':a.gross_total, 'details ':b.details }); }).catch(function (e) { console.log(e); alert("Sorry, Something went wrong"); }) }).catch(function (e) { console.log(e); alert("Sorry, Something went wrong");})
Mysql implementation
SELECT quote_items.id AS id, quote_items.product_name AS product_name ...... FROM quote_items, products WHERE quote_items.quote_id = quote_id AND products.id = quotes_items.produc_id
Expected implementation in Realm.io for Android
RealmResults result = realm.where(quote_items.class) .equalTo("quote_id", quote_id).equalTo("quote.product_id", quote_id).equalTo("product.product_id", "quotes.itemkey").findAll()
Realz source share