Git Product home page Git Product logo

apiblogexpressmongoose's Introduction

Introduction

Api Blog application built wit NodeJs Express and Mongoose, project far from finished.

Play with the models

db.comments.count({replies: {$exists: true, $not: {$size: 0}}})
db.post.find({'author.$id': 'foo'})
db.users.count({roles: {$exists: true, $in: [ObjectId('5c00ff848e15881074f622f6')]}})
db.comments.count({replies: {$exists: true, $not: {$size: 0}})
db.comments.aggregate({$project: { numberOfReplies: {$size: '$replies'}}})

// count replies count
// inline, from https://glassonionblog.wordpress.com/2013/04/07/mongodb-aggregate-lengths-of-neste-arrays/
db.comments.mapReduce(function(){emit('replies', {count: this.replies.length});}, function(key,values){var result={count:0}; values.forEach(function(value){result.count +=value.count;});return result}, {out: {inline:1}})
{ $where: "this.following.length > 1" }

TODO

  • Populate comments_count in articles.index
  • Seed likes
  • Refactor the user subscriptions(following/follower pattern)
  • Improve seeding user subscriptions, it does not check if already following
  • Fix comments not showing in dto. ArticleController.getBySlugOrId
  • Refractor user model, I use pdkfb2 which i replaced by bcrypt
  • Replace bcrypt-nodejs by bcrypt
  • Customize Passport unauthorized response
  • Get by tag Name, working only for by tag Id
  • Move the param loaders to app.js
  • The first time the seed runs, the users array contains a bunch of nulls this is the reason why comments have user = null, fix it.
  • Improve error messages, for example if article creation fails
  • Find a way to paginate user subscriptions

apiblogexpressmongoose's People

Contributors

melardev avatar

Watchers

James Cloos avatar  avatar

Forkers

frsknalexis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.