Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Any way to generate a JSON-Schema from a Collection?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Julien Chaumond  
View profile  
 More options Oct 10 2012, 4:16 am
From: Julien Chaumond <chaum...@gmail.com>
Date: Wed, 10 Oct 2012 00:48:08 -0700 (PDT)
Local: Wed, Oct 10 2012 3:48 am
Subject: Any way to generate a JSON-Schema from a Collection?
Hi,

Has anyone worked on a way to generate a (tentative) JSON-Schema
(http://json-schema.org/) from an existing Collection?

Thanks,

Julien


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Reno Reckling  
View profile  
 More options Oct 10 2012, 5:21 am
From: Reno Reckling <exi+goo...@wthack.de>
Date: Wed, 10 Oct 2012 11:21:18 +0200
Local: Wed, Oct 10 2012 5:21 am
Subject: Re: [mongodb-user] Any way to generate a JSON-Schema from a Collection?
Hi

> Has anyone worked on a way to generate a (tentative) JSON-Schema
> (http://json-schema.org/) from an existing Collection?

Wouldn't that imply that a collection even has a specific schema?
In mongodb every document within a collection can have a different structure so generating a schema
for a collection seems a little bit pointless.
Or am I missing something?

Regards,
Reno


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Chaumond  
View profile  
 More options Oct 10 2012, 7:03 am
From: Julien Chaumond <chaum...@gmail.com>
Date: Wed, 10 Oct 2012 04:03:08 -0700 (PDT)
Local: Wed, Oct 10 2012 7:03 am
Subject: Re: Any way to generate a JSON-Schema from a Collection?
Hi Reno,

Well, the fact that a Collection doesn't need to have a schema doesn't
mean it can't have a schema, right?

Julien

On Oct 10, 11:21 am, Reno Reckling <exi+goo...@wthack.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Millman  
View profile  
 More options Oct 10 2012, 7:54 am
From: Sam Millman <sam.mill...@gmail.com>
Date: Wed, 10 Oct 2012 12:53:57 +0100
Local: Wed, Oct 10 2012 7:53 am
Subject: Re: [mongodb-user] Re: Any way to generate a JSON-Schema from a Collection?

I do not believe anyone has.

I have to be honest, this is the first time I have seen this and since it
is only a draft and not a recognised schema/standard I doubt there has been
much work with MongoDB in relation to this schema type.

On 10 October 2012 12:03, Julien Chaumond <chaum...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Steneker  
View profile  
 More options Oct 10 2012, 7:59 am
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Wed, 10 Oct 2012 04:59:58 -0700 (PDT)
Local: Wed, Oct 10 2012 7:59 am
Subject: Re: Any way to generate a JSON-Schema from a Collection?

> Has anyone worked on a way to generate a (tentative) JSON-Schema
> (http://json-schema.org/) from an existing Collection?

Hi Julien,

A few folks have mentioned interest in using JSON Schema Validation but I
haven't come across any generic implementations for generating or
validating JSON-Schema from MongoDB yet.

Some ingredients that may help you get started:
 * Schema.js: a MongoDB schema analysis tool
(http://skratchdot.com/projects/mongodb-schema/)
 * JSON-Schema-Generator
(https://github.com/jsonschema/JSON-Schema-Generator)
 * JSV: JSON Schema Validator (https://github.com/garycourt/JSV)

Schema.js uses MapReduce to work out the coverage and types of fields in a
collection, so you could massage the results from that to generate your
JSON Schema.  For example, you could infer based on the 'coverage %'
whether a field should be optional or required.  You could use JSV to
validate documents against the expected schema.

I'd be interested to see if anyone does have solutions.  The JSON-Schema
spec is still an evolving draft so you would definitely be an early adopter
;-).

Cheers,
Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Travis Laborde  
View profile  
 More options Oct 10 2012, 9:28 am
From: Travis Laborde <travislabo...@gmail.com>
Date: Wed, 10 Oct 2012 06:28:49 -0700 (PDT)
Local: Wed, Oct 10 2012 9:28 am
Subject: Re: Any way to generate a JSON-Schema from a Collection?

there is a nice script available here that might help you:
https://github.com/variety/variety

Travis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »