3

All the examples I've found for Foxx.Model schemas are flat - i.e. they don't include nested objects.

I'm trying to add a hash to save geo info on a model like this:

var Foo = Foxx.Model.extend({
    schema: {
      name: joi.string().required(),
      location: joi.object().keys({
        lat: joi.number(),
        lng: joi.number()
      })
    }
});

This shows up in the Foxx interface Data Type as this:

foo {
    name (string),
    location (object, optional)
}

How do I get it to show the key names 'lat' and 'lng' for the location object?

Or am I thinking about this incorrectly?

asm
  • 63
  • 1
  • 5

1 Answers1

3

You are using it correctly and it will work and check your object correctly. This is just a limitation of the documentation tool used in the admin interface of ArangoDB.

moonglum
  • 801
  • 5
  • 13