GithubHelp home page GithubHelp logo

mongodb-practice's Introduction

mongodb-practice

Set of tasks for practicing mongodb commands/queries

References:

You're creating a database for a small-time CRM (Customer Relationship Management) system.

  1. Create a collection of customers.
  2. Add a new customer with a business_name of Acme, num_employees of 1200, account_value of 50000
  3. Add a new customer with a business_name of Apple, num_employees of 35100, account_value of 23000000
  4. Add a new customer with a business_name of Ma&Pa, num_employees of 15, account_value of 1200

Now, practice querying for results:

  1. Select all customers with an account value of greater than 10000
  2. Select only names of businesses that have less than 2000 employees
  3. Select all customers sorted by number of employees (ascending, or lowest to highest)
  4. Select the id of customers whose business name's begin with 'A' (hint: http://docs.mongodb.org/manual/reference/operator/query/where/#op._S_where)

Let's modify some of our records:

  1. Add a rep for each record in the collection:
  • For Acme, rep name: 'Wile E. Coyote', employee #: 4311
  • For Apple, rep name: 'Fan Boi', employee #: 1216
  • For Ma&Pa, rep name: 'Jedediah', employee #: 5918
  1. Update every customer to have an active status of true
  2. Update Ma&Pa to have 20 employees and an account_value of 2500
  3. Select the rep names of every customer

mongodb-practice's People

Contributors

cahlan avatar

Watchers

James Cloos avatar  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.