I am facing an issue with accessing MongoDB in my IONIC project. Despite using a controller and having functions available in the template, I can't seem to connect to mongoDB. I am unsure of how to resolve this problem.
$scope.InsertUser = function(){
user = $("#NameId").val();
db.users.insert(user);
}
Upon checking the log, it states "db is not defined". While I understand that this cannot be used on the client side, I am puzzled about where the server side should be located. Here's the directory tree structure of my project:
I have searched through various videos and tutorials, but I still can't figure out where to declare my collections or place my CRUD methods such as: db.users.insert(user);
If anyone has insights on how to handle this issue, your help would be greatly appreciated!