Code Monkey home page Code Monkey logo

mongodb_ageneralpurposedb's Introduction

MongoDB - A General Purpose DB

The code behind a website that demonstrates MongoDB is a general purpose database: http://www.mygiantidea.com

Introduction

Getting Started

To install locally run npm install

You should have a MongoDB instance available and the Yelp database loaded. This demo database is not included in this repository due to the size.

Create a .env file which contains the connection credentials to your local MongoDB instance (see dotenv). The contents of the file should be similar to the following:

    DB_HOST=127.0.0.1
    DB_PORT=27017
    DB_NAME=yelp
    DB_USERNAME=webuser
    DB_PASSWORD=webpassword

To run node app.js

Creating Indexes and Other Setup Tasks

Text Search example requires an index. Create one from the shell using:

db.business.createIndex({name:'text'})

GraphLookup benefits greatly from a single field index. Create one from the shell using:

db.users.createIndex({user_id:1})

For Geospatial queries to work, a schema change is needed. A special 2dsphere index needs an object that adheres to the GeoJSON standard. For this you will need to execute our helper script that will copy the longitude and latitude fields into an object called location. Inside location we will have a type: "Point" and an array called coordinates with the longitude and latitude as the only 2 elements.

node config/yelp_prep.js

This will run against all 174K docs under the business collection. Once this completes you can now create the 2dsphere index. Create one from the shell using:

db.business.createIndex({location:'2dsphere'})

Known Issues & Limitations

List of issues, Limitations, and to-dos.

All issues and limitations have moved to the Issues part of this repo.

Contacts

For technical questions, issues or just comments please post in the Issues section on GitHub.

Disclaimer

This software is not supported by MongoDB, Inc. under any of their commercial support subscriptions or otherwise. Any usage of MongoDB_AGeneralPurposeDB is at your own risk. Bug reports, feature requests and questions can be posted in the Issues section on GitHub.

mongodb_ageneralpurposedb's People

Contributors

rwaltersma avatar wbleonard avatar fullaware avatar dependabot[bot] avatar mchinnasamy avatar

Stargazers

ALIROT01 avatar

Watchers

Blaine Mincey avatar James Cloos avatar Marcelo Rocha DaSilva avatar  avatar  avatar

mongodb_ageneralpurposedb's Issues

/routes/AggFramework.js issue with `bson` require

internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module 'bson'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/Users/bnewell/projects/MongoDB_AGeneralPurposeDB/routes/aggframework.js:4:10)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)

Refactor Sidebar Into A Partial

The sidebar menu is duplicated in each template. As we add new examples, every template needs to be updated with the link to the new example. I propose moving the sidebar into a partial that's included in each template.

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.