Questions tagged [mean-stack]

The MEAN stack is a methodology that employs MongoDB, Express, Angular / AngularJS, and Node.js to provide a complete end-to-end system. One of the primary motivations for such a stack is that it is pure JavaScript at all ends. Two different implementations are available: mean.io and mean.js

MEAN (an initialism for Mongo, Express, Angular, Node) stack can be implemented just as LAMP stack is implemented, with or without a specific framework or architecture as the four technologies can be implemented in completely different ways.

A ready-to-go implementation is available at meanjs.org.

Related tags:

3884 questions
6
votes
0 answers

Allow only one document in mongodb collection

I'm writing the backend for an application that needs to store some preferences. I'm using the MEAN stack so the back end is express + mongodb. I'm using mongoose for this. The database has to have a unique preference document that is present when…
Sam
  • 341
  • 1
  • 4
  • 15
6
votes
1 answer

Mean.js Multiple Layouts, Server or Angular Layout

I've been developing a mean.js application. I have an admin theme that I'm trying to integrate with the existing application. My question is Can we have multiple Server Layouts, ? If the logged-in user is Regular User, use layout-1 if the user…
Ronak Jain
  • 1,723
  • 2
  • 24
  • 35
6
votes
1 answer

MEAN JS - where is the main html file (index.html) located

I just started learning MEAN JS and I am trying to find the html file for the main page. However I only see home.client.view.html and header.clinet.view.html in the view folder. From what I know is, usually there is a main html which holds all the…
Gong Yibo
  • 73
  • 1
  • 5
6
votes
2 answers

Send update notification to particular users using socket.io

Following is the code on front end, where storeSelUserId contains user_id to send the message- FYI - Node Version 1.1.0 // Socket Notification var socket = io('http://localhost:6868'); socket.on('connection', function (data) { socket.emit('send…
Trialcoder
  • 5,816
  • 9
  • 44
  • 66
6
votes
2 answers

I keep getting TypeError: undefined is not a function

I keep getting the above error when running the following code in a MEAN stack app: $scope.completelesson = function(lessonindex, type) { //a variable that will be appended to 'level' in order to access the level property of the user …
6
votes
1 answer

Using the find method on a MongoDB collection with Monk

I am working through a MEAN stack tutorial. It contains the following code as a route in index.js. The name of my Mongo collection is brandcollection. /* GET Brand Complaints page. */ router.get('/brands', function(req, res) { var…
jdw
  • 3,755
  • 3
  • 17
  • 16
6
votes
1 answer

MEAN stack and bootstrap / bower issue

I'm currently exploring new ways to develop and have come across the MEAN stack, which can be found here - http://mean.io/#!/ I have installed Mongo, Node (plus npm etc...) and gone through all the steps stated on the website. The issue comes when I…
user1197220
  • 117
  • 3
  • 12
6
votes
2 answers

registerModule with dependencies

I'm building an app with MEAN.JS and I'm trying to use a controller from another module. I've found that I can do this with dependency injection: angular.module(‘MyModule’, [‘Dependency’]); But the way modules are created in MEAN.JS…
Salvatorelab
  • 11,614
  • 6
  • 53
  • 80
6
votes
4 answers

How to use socket.io with the latest mean.io?

I have fetched a copy of the latest Mean.io and noted quite a number of changes compared to the previous version I have been working with before. Now, what I am doing is creating a very basic chat application that uses socket.io with rooms.…
Severin
  • 8,508
  • 14
  • 68
  • 117
6
votes
1 answer

Concurrent access to a document with mongoose

I am writing a web application where more users can perform simultaneous operation in the same document in mongodb. I use the mean.io stack, but I am quite new to it. I was wondering how does mongoose manage concurrency. Every "user click" operation…
Enrico
  • 364
  • 1
  • 6
  • 11
6
votes
2 answers

node express upload file with mean stack

I should implement an upload form I thought of using bodyparser but I read http://andrewkelley.me/post/do-not-use-bodyparser-with-express-js.html so what's the way to upload a file with express using the mean stack ? may be formidable or other…
Whisher
  • 31,320
  • 32
  • 120
  • 201
5
votes
1 answer

mongorestore error Failed: EOF when restore DB from dump.gz

I am getting error while importing DB backup using mongorestore command with dump.gz Using following command to restore DB: mongorestore --gzip --archive=dump.gz --nsInclude=MyApp Getting following error: 2019-12-04T14:14:40.352+0530 Failed:…
Nisar Saiyed
  • 728
  • 1
  • 8
  • 17
5
votes
2 answers

Fixing Reflected XSS issue in Javascript. CheckMarx

I was trying to validate my code using CheckMarx but am stuck at a couple of vulnerabilities that I am unable to find a fix for. The following are the code lines where the vulnerabilities were raised. window.location.href = url + "?"+"appPageId="+ …
Tejas Jaggi
  • 115
  • 1
  • 9
5
votes
1 answer

Unable to register service worker in angular using angular cli

I am trying to covert my angular app into a PWA so tried to add service worker using npm install @angular/service-worker --save and ng add @angular/pwa then after that I build the app in production mode using ng build --prod and serve the app using…
Rupesh
  • 840
  • 1
  • 12
  • 26
5
votes
1 answer

MEAN IO : Config validation error JWT_SECRET is required

I am setting up a new mean project from mean.io clone. after installing the npm packages and starting the mongod. I run npm start it gives me this eror. Error: Config validation error: child "JWT_SECRET" fails because ["JWT_SECRET" is…
Sami
  • 1,041
  • 3
  • 16
  • 32