Skip to content

Possible json format for a chapter document

dweinerATL edited this page Sep 28, 2014 · 3 revisions

Here is a possible json format for a document to describe a chapter:

{
    "_id" : ObjectID(),
    "chapter_name" : "HMS Gaheris",
    "chapter_type" : "ship|mardet|bivouac|division|task group|task force|squadron|fleet|district|corp|theater|command",
    "hull_number" : "DD-482",
    "activation_date" : "20XX-XX-XX",
    "assigned_to" : ObjectID()

}

Using this format, we can just walk up the chain. Imagine this force structure:

3rd Fleet -> DesRon 31 -> DesDiv 311 -> Ship 1 & Ship 2

Ship 1 and 2 would have all the fields filled out, and the assigned_to would hold the MongoID of DesDiv311

DesDiv311 would not even have hull_number in the document and assigned_to would point to DesRon 31

DesRon31 would also not have hull_number in the document and assigned_to would point to 3rd Fleet

3rd Fleet would also not have hull_number in the document and either would not have assigned_to or if they did, it would point to say, BuShip or Admiralty House

If we want a roster for Ship 1, we query the user collection for all documents where chapter.chapter_id is equal to Ship 1's Mongo ID. The billets are stored in the user document, so we now give the ships command crew the ability to add billets for members, and we filter/don't allow the command crew to set the CO, XO or BOSUN billet, only those with the appropriate authorization can do that.