Skip to content

Instantly share code, notes, and snippets.

@ciberch
Created September 6, 2012 21:10
Show Gist options
  • Select an option

  • Save ciberch/3660396 to your computer and use it in GitHub Desktop.

Select an option

Save ciberch/3660396 to your computer and use it in GitHub Desktop.
Snippet showing how to store location for Activity Streams in MongoDB via Mongoose
var LocationHash = {
displayName: {type: String},
position: {
latitude: Number,
longitude: Number
}
};
var ActivityObjectHash = {
id: {type: String},
image: {type: MediaLinkHash, default: null},
icon: {type: MediaLinkHash, default: null},
displayName: {type: String},
summary: {type: String},
content: {type: String},
url: {type:String},
published: {type: Date, default: null},
objectType: {type: String},
updated: {type: Date, default: null},
location: LocationHash,
fullImage : {type: MediaLinkHash, default: null},
thumbnail : {type: MediaLinkHash, default: null},
author : {type: ObjectId, ref: "activityObject"},
attachments : [{type: ObjectId, ref: 'activityObject'}],
upstreamDuplicates : [{type: String, default: null}],
downstreamDuplicates : [{type: String, default: null}]
};
@ciberch
Copy link
Author

ciberch commented Sep 6, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment