Created
September 6, 2012 21:10
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}] | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the complete file see https://github.com/ciberch/activity-streams-mongoose/blob/master/lib/activityMongoose.js#L15