New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB Error in Todo_App_Mongo example #134
Comments
I installed mongodb-wrapper inside the global geddy/node_modules dir, and I get a new error.
|
Very odd, can you post the results of this:
Thanks! |
$ node -v |
FWIW: Here's the repo for my build. https://github.com/meshachjackson/Geddy-Sample-App git@github.com:meshachjackson/Geddy-Sample-App.git |
So it looks like you're not providing a callback for the 'all' method on the adapter. |
If I start completely from scratch, I can get the same error with the following steps.
This seems to load fine, then when I hit the url with a browser, I get the following in the terminal: First, I get all the 'success' messages for starting the server...
... then, when I hit the url...
|
... Do you mean the index method in controller? I'm using the example code provided. Here's the method with the callback in place... this.index = function (req, resp, params) {
var self = this;
geddy.model.adapter.Todo.all(
{status: {'in': ['open','done']}}
, {sort: {status: -1, title: 1}}
, function(err, todos){
self.respond({params: params, todos: todos});
}
);
}; |
Looks like you don't have mongo running... Sent from my iPhone On May 3, 2012, at 3:57 PM, Meshach Jacksonreply@reply.github.com wrote:
|
? I've got several other apps running with Mongo on the same machine. A few with express JS using a Mongoose connector. I think the issue is related to the example app having 2 references to the same mongo conection info... /todo_app_mongo/config/init.js var mongo = require('mongodb-wrapper');
geddy.db = mongo.db('localhost', 27017, 'todo');
geddy.db.collection('todos');
// Add uncaught-exception handler in prod-like environments
if (geddy.config.environment != 'development') {
process.addListener('uncaughtException', function (err) {
geddy.log.error(JSON.stringify(err));
});
} /todo_app_mongo/config/development.js /*
* Geddy JavaScript Web development framework
* Copyright 2112 Matthew Eernisse (mde@fleegix.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var config = {
detailedErrors: true
, debug: true
, hostname: null
, port: 4000
, sessions: {
server: {
host : 'localhost'
, port : 27017
, db : 'testDB'
, collection : 'sessions'
}
, store: 'mongodb'
, key: 'sid'
, expiry: 14 * 24 * 60 * 60
}
, db: {
mongo: {
db: "todo"
}
}
};
module.exports = config; |
Right! Sorry, tomorrow I'll give you a much more detailed overview of the fix for this, but for now, check out how the related_models example app is implemented. Model adapters are no longer required. Sent from my iPhone On May 3, 2012, at 5:09 PM, Meshach Jacksonreply@reply.github.com wrote:
|
I've been trying to get the example todo app to work with mongo. I've been through the docs, tutorials, and searched for similar bugs, and I just can't seem to find an answer here. I've run npm install -l on 'mongodb', 'metrics', and 'mongodb-wrapper', and still, when I run 'geddy', I get the following:
The text was updated successfully, but these errors were encountered: