Auto-generated array field lengths

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Auto-generated array field lengths

bserdar
We auto-generate array field length fields in metadata. This is one of those things that I thought would be useful, but it turned out to be useless, and worse, confusing and problematic.

I suggest we stop auto-generating those fields in metadata. We can still populate the array sizes if they are defined in metadata, but if they are not, we won't add them.

Thoughts?
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

jewzaam
Administrator
Do we have no use case where it's important in a request to know the size of an array?

On Fri, Sep 11, 2015 at 1:52 PM bserdar [via lightblue-dev] <[hidden email]> wrote:
We auto-generate array field length fields in metadata. This is one of those things that I thought would be useful, but it turned out to be useless, and worse, confusing and problematic.

I suggest we stop auto-generating those fields in metadata. We can still populate the array sizes if they are defined in metadata, but if they are not, we won't add them.

Thoughts?


If you reply to this email, your message will be added to the discussion below:
http://dev.forum.lightblue.io/Auto-generated-array-field-lengths-tp389.html
To start a new topic under lightblue-dev, email [hidden email]
To unsubscribe from lightblue-dev, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

bserdar
I haven't seen one yet. And if there is, with this solution, you can
still define a length field and use it.

On Fri, Sep 11, 2015 at 11:56 AM, jewzaam [via lightblue-dev]
<[hidden email]> wrote:

> Do we have no use case where it's important in a request to know the size of
> an array?
>
> On Fri, Sep 11, 2015 at 1:52 PM bserdar [via lightblue-dev] <[hidden email]>
> wrote:
>>
>> We auto-generate array field length fields in metadata. This is one of
>> those things that I thought would be useful, but it turned out to be
>> useless, and worse, confusing and problematic.
>>
>> I suggest we stop auto-generating those fields in metadata. We can still
>> populate the array sizes if they are defined in metadata, but if they are
>> not, we won't add them.
>>
>> Thoughts?
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://dev.forum.lightblue.io/Auto-generated-array-field-lengths-tp389.html
>> To start a new topic under lightblue-dev, email [hidden email]
>> To unsubscribe from lightblue-dev, click here.
>> NAML
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://dev.forum.lightblue.io/Auto-generated-array-field-lengths-tp389p390.html
> To start a new topic under lightblue-dev, email
> [hidden email]
> To unsubscribe from lightblue-dev, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

dcrissman
Do size fields need to be stored in mongo? Could they simply be calculated on the fly?
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

bserdar
They are stored in mongo. That was the point: to query by array size.

On Fri, Sep 11, 2015 at 12:53 PM, dcrissman [via lightblue-dev]
<[hidden email]> wrote:

> Do size fields need to be stored in mongo? Could they simply be calculated
> on the fly?
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://dev.forum.lightblue.io/Auto-generated-array-field-lengths-tp389p392.html
> To start a new topic under lightblue-dev, email
> [hidden email]
> To unsubscribe from lightblue-dev, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

dcrissman
In reply to this post by dcrissman
The lightblue-ldap controller does this already. Because ldap has a non-negotiable datastore, we strip out count fields on the way in, and calculate them on the way out.
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

jewzaam
Administrator

I believe mongo cannot query for array size.


On Fri, Sep 11, 2015, 3:00 PM dcrissman [via lightblue-dev] <[hidden email]> wrote:
The lightblue-ldap controller does this already. Because ldap has a non-negotiable datastore, we strip out count fields on the way in, and calculate them on the way out.


If you reply to this email, your message will be added to the discussion below:
To start a new topic under lightblue-dev, email [hidden email]
To unsubscribe from lightblue-dev, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

dcrissman
In reply to this post by bserdar
Seems to me then that there are two pieces here then. Storing the size fields in the underlying data store, and exposing the size fields via the lightblue api.

The LDAP example I spoke of, artificially adds the size fields in order to support the lightblue api.

If we no longer store the size in the underlying datasource (mongo), then do we still need to provide the size via the api. Or should the api provide the size fields regardless of the datasource?
Reply | Threaded
Open this post in threaded view
|

Re: Auto-generated array field lengths

bserdar
We do store the size in mongo, and I am not proposing to change that.
What I am proposing is to not auto-add the length field to metadata,
and to populate the length field only if it is defined. So, if you
don't define the length field in metadata, it won't be added to the
metadata, nor will it be computed and added to the documents.

On Mon, Sep 14, 2015 at 7:48 AM, dcrissman [via lightblue-dev]
<[hidden email]> wrote:

> Seems to me then that there are two pieces here then. Storing the size
> fields in the underlying data store, and exposing the size fields via the
> lightblue api.
>
> The LDAP example I spoke of, artificially adds the size fields in order to
> support the lightblue api.
>
> If we no longer store the size in the underlying datasource (mongo), then do
> we still need to provide the size via the api. Or should the api provide the
> size fields regardless of the datasource?
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://dev.forum.lightblue.io/Auto-generated-array-field-lengths-tp389p396.html
> To start a new topic under lightblue-dev, email
> [hidden email]
> To unsubscribe from lightblue-dev, click here.
> NAML