Code Monkey home page Code Monkey logo

demo's Introduction

  1. Used MongoDB Database and implemented the project.
  2. There are three collections I create. a. Posts – This collection is used for original tweet. b. Comments – This collection is used for all Comments being created to the posts. Please note unique key for post is present in this document. c. Reaction - This collection is used for all reaction posted on individual post or comment. Please note unique key for post/comment is present in this document.

End points for three use cases in question –

  • Get /v1/tweetswithmaxcomments
  • Get /v1/userswithmaxtweets
  • Get /v1/userswithmaxinteractions

End points for other cases –

  • Post /v1/tweet This end point is for a new tweet or post.
  • Post /v1/comment. This end point is for new comment posted.
  • Post /v1/reaction. This end point is for new reaction.
  • Get /v1/tweets. This end point is for get all tweets in last 5 days. Pass query parameter days to get other then 5 days. E.g. /tweets?days=7 will give you tweets from last 7 days.

DataStructure

Post or tweet =

{ "type": "Tweet.Post", "title": "second tweet", "createdAt": "2022-02-11", //UTC date time. "actor": { "id": "uniqueId", "name": "name", "handle": "@someHandle" }, "content": "200 characters long utf-8 formatted another content" }

Comment – { "type": "Tweet.Comment", "id": "uniqueIdInString", "title": "stringData", "createdAt": "2022-02-11", //UTC date time. "actor": { "id": "uniqueId", "name": "name", "handle": "@someHandle" }, "refId": "stringData" "content": "200 characters long utf-8 formatted content" }

Reaction – { "type": "Tweet.Comment", "id": "uniqueIdInString", "title": "stringData", "createdAt": "2022-02-11", //UTC date time. "actor: { "id": "uniqueId", "name": "name", "handle": "@someHandle" }, "refId": "stringData" "content": "200 characters long utf-8 formatted content" }

demo's People

Contributors

ajdanaher avatar anjoshi avatar

Watchers

 avatar

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.