Geomongo db schema

MasterDB

A database with meta-information about existing services and users.

users

Collection with users/administrations of the services and/or instance of platform.

{
    "first_name": {
        "type": "string"
    },
    "last_name": {
        "type": "string"
    },
    "required": [
        "first_name",
        "last_name"
    ]
}

services

Collection with meta-information of existing services.

{
    "name": {
        "type": "string"
    },
    "config": {
        "type": "object",
        "properties": {
            "log_size": {
                "type": "integer"
            }
        },
        "required": [
            "log_size"
        ]
    },
    "owner_id": {
        "type": "string"
    },
    "required": [
        "config",
        "name",
        "owner_id"
    ]
}

log

Action log administrators of the instance and services.

{
    "user_id": {
        "type": "string"
    },
    "date": {
        "type": "Datetime"
    },
    "message": {
        "type": "string"
    },
    "service": {
        "type": "string"
    },
    "required": [
        "user_id",
        "date",
        "message",
        "service"
    ]
}

ServiceDb

Database with data of specific service. One service needs one serviceDb.

log

Action log users of specific service. 

{
    "user_id": {
        "type": "string"
    },
    "date": {
        "type": "Datetime"
    },
    "message": {
        "type": "string"
    },
    "service": {
        "type": "string"
    },
    "required": [
        "user_id",
        "date",
        "message",
        "service"
    ]
}

points

Points added by users of the service.

{
    "name": {
        "type": "string"
    }
    "json": {
        "type": "object",
        "properties": {
            "import_source": {
                "type": "Url"
            },
            "version": {
                "type": "string"
            },
            "image_url": {
                "type": "Url"
            },
            "name": {
                "type": "string"
            },
            "source_url": {
                "type": "Url"
            }
            "date":{
                "type": "Datetime"
            }
            "bc":{
                "type": "boolean"
            }
        }
    },
    "channelId": {
       "type": "string"
    },
    "location": {
        "type": "object",
        "properties": {
            "coordinates": {
                "type": "array",
                "size": 2
                "items": {
                    "type": "float"
                }
            }
        },
        "required": [
            "coordintes"
        ]
    },
    "date":{
        "type": "Datetime"
    }
    "bc":{
        "type": "boolean"
    }
    "alt": {
        "type": "non negative float"
    }, 
    "required": [
        "json"
        "channelId",
        "location"
        "date",
        "bc",
        "alt"
    ]
}

channels

The channels of specified service.

{
    "name": {
      "type": "string"
    },
    "json": {
        "type": "object",
        "properties": {
            "description": {
                "type": "string"
            },
            "url": {
                    "type": "string"
            }
        }
    "owner_id": {
        "type": "string"
    },
    "required": [
        "name",
        "json",
        "owner_id"
    ]
}

http://docs.mongodb.org/manual/reference/database-references/

ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone