What should the exports.paths look like in the flashlight config.js for nested types

27 views
Skip to first unread message

alex....@gmail.com

unread,
Jul 28, 2015, 8:53:35 PM7/28/15
to Firebase Google Group
Hi,

I have some data as follows.


    "sense_examples": {
        "-JvL_TBo-skW0UsJ2A8s": [{
            "source": "en-gb_zu_dict/20150722_878",
            "lang": "en-gb",
            "text": "He's a teacher",
            "example_id": "-JvL_TBoGemVceuw60T-"
        }],
      
        "-JvL_TCTkZJ4ltzncymn": [
            {
                "source": "en-gb_zu_dict/20150722_878",
                "lang": "en-gb",
                "text": "I have come here so that we can talk about what happened yesterday",
                "example_id": "-JvL_TCUP6nklOhw_t-J"
            },
            {
                "source": "en-gb_zu_dict/20150722_878",
                "lang": "en-gb",
                "text": "My house is about five minutes' walk from my school",
                "example_id": "-JvL_TCVideSNdg1uK7O"
            }
        ],

In editing the config.js file that comes with flashlight I thought perhaps leaving the fields blank might index things however it doesn't work. I've tried a number of possibilities.

 {
      path:  "sense_examples",
      index: "firebase",
      type:  "sense_examples"
   }

Any thoughts on how I need to edit the exports.paths effectively to index the nested objects under sense_examples?

Thanks
Alex

Kato Richardson

unread,
Jul 28, 2015, 11:23:53 PM7/28/15
to fireba...@googlegroups.com
Alex,

If your keys indeed reference arrays, you won't be able to index them. You'd need to modify this data structure to use a hash and nix the arrays. You may be able to get some ideas from our structuring data guide.

I hope that helps!
Kato


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/31737d08-115f-4cdf-b035-bb5ed84611d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Muir

unread,
Jul 29, 2015, 6:25:33 AM7/29/15
to fireba...@googlegroups.com
Kato,

Thanks,,  that resolved the problem..

Regards
Alex


Regards
Alex
www.tilogeo.com

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/0Wp9hlCxq8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages