0.1.2 • Published 12 years ago

activity-streams-mongoose v0.1.2

Weekly downloads
57
License
-
Repository
github
Last release
12 years ago

Overview

Activity Streams is a simple specification used to describe social actions around the web. http://activitystrea.ms

This library provides the following Activity Stream Models on Mongoose:

  • ActivityObject
  • Activity

For details on the properties each see pne of the following specifications:

Usage

First require the library passing an instance of Mongoose

var mongoose = require('mongoose');
mongoose.connect(siteConf.mongoUrl);
var asmsDB = require('activity-streams-mongoose')(mongoose);

To create an activity object you can do

var cf = new asmsDB.ActivityObject({displayName: "Cloud Foundry" , url: "http://www.cloudfoundry.com"});
cf.save(function (err) {
    //...
    }
});

To create an activity with an associated activity object you can do

var testAct = new asmsDB.Activity({title: "Started the app", target: target._id});
testAct.save(function (err) {
    //...
});

To query the Activity Streams do

Asking for the latest 5:

asmsDB.getActivityStream(5, function (err, docs) {
   docs.forEach(function(doc){console.log(doc);});
});
0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.14

12 years ago

0.0.13

12 years ago

0.0.12

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

12 years ago

0.0.8

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago