sentEmails hasMany sentEmailViews, and sentEmailViews belongsTo sentEmails but the relation uses the emailId to establish the relationship. Is this possible in LoopBack? Any help is appreciated!
I'm trying to query sentEmails including sentEmailViews for each sentEmails that's found.
--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Did you check out http://docs.strongloop.com/display/LB/Creating+model+relations? There are examples.
Thanks,---Raymond FengCo-Founder and Architect @ StrongLoop, Inc.
StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.
Can I assume sentEmailViews.emailId is the FK and sentEmails.emailId is the PK?
Sent from my iPhone 6 Plus
On Feb 18, 2015, at 4:18 AM, Sanjay Pandey <vigya...@gmail.com> wrote:
hey Charles,Did you get any way to reference two models through a property other than primary key? I am also looking for solution to this problem.
On Oct 14, 2015, at 8:46 AM, eric.b...@carbip.com wrote:
Hi, any news on this loopback team? the post trail is old now and I guess there were some additions on this as there are a bunch of id parameters to play with such as 'generated'.i'm using mongo with this model configuration:
{"name": "myModel","plural": "myModels","base": "PersistedModel","idInjection": false,"options": {"validateUpsert": true},"properties": {"other_id": {"type": "string","generated":false,"id":true,"index": {"unique": true},"required": true},...}
and i can't reference instances of this model parent using this other_id of mine as the primary key for related model foreign key.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/9e68cf7d-7cfb-40ab-82df-0fc8e628c8e0%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "LoopbackJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/loopbackjs/F1JcB4bTtxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/A72E23BA-8787-46EA-B7B0-A525D7487C0B%40strongloop.com.
For more options, visit https://groups.google.com/d/optout.