Skip to content

Instantly share code, notes, and snippets.

@dbarjs
Last active May 18, 2016 20:45
Show Gist options
  • Save dbarjs/f11fc11bd59558fc54ac2c2c1f67476d to your computer and use it in GitHub Desktop.
Save dbarjs/f11fc11bd59558fc54ac2c2c1f67476d to your computer and use it in GitHub Desktop.
/*
table structures
meta_rules
_id
app_id
contentType
file_rules
_id
app_id
contentType
*/
var app = {
name: 'test',
rules: {
restricted: true,
meta: {
rules: [
{
name: 'name',
contentType: 'string'
},
{
name: 'age',
contentType: 'number'
}
]
},
files: {
rules: [
{}
]
}
}
};
var appString = JSON.stringify(app);
// $app = json.decode($_POST['app']);
//return
var app = {
_id: 'J#$#$#465d',
name: 'test',
rules: {
restricted: true,
meta: [
{
name: 'name',
contentType: 'string'
},
{
name: 'age',
contentType: 'number'
}
],
files: [
{
name: 'photo',
contentType: 'image',
max: 5000,
min: 1000
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment