Permalink
Browse files

activity fixed

  • Loading branch information...
1 parent a6ceece commit 1c6ac707a08bcd9165e533934f203f5a42f8e5eb @rxkh rxkh committed May 9, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 server/activity.js
View
@@ -129,7 +129,7 @@ function getActivityById(activityid, callback) {
redis.hgetall('activities:' + activityid, function (err, activity) {
console.log('Get activity by id:' + activityid);
if (!activity) {
- db.activities.find({_id: db.ObjectId(activityid)},
+ db.activities.findOne({_id: db.ObjectId(activityid)},
function (err, activity) {
callback(activity);
});
@@ -148,7 +148,7 @@ function findActivityByCreator(callback) {
var objs = new Array();
var counter = 0;
for (aid in data) {
- db.activities.find({_id: db.ObjectId(data[aid])}, function (err, activity) {
+ db.activities.findOne({_id: db.ObjectId(data[aid])}, function (err, activity) {
if (!activity) return;
delete activity['null'];
objs.push(activity);
@@ -170,7 +170,7 @@ function findActivityByParticipant(callback) {
var objs = new Array();
var counter = 0;
for (aid in data) {
- db.activities.find({_id: db.ObjectId(data[aid])}, function (err, activity) {
+ db.activities.findOne({_id: db.ObjectId(data[aid])}, function (err, activity) {
if (!activity) return;
delete activity['null'];
objs.push(activity);

0 comments on commit 1c6ac70

Please sign in to comment.