GithubHelp home page GithubHelp logo

mongodb-fs's People

Contributors

erunion avatar openhoat avatar parisholley avatar parkr avatar vladlosev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mongodb-fs's Issues

Reject empty $set operator in update

update and findandmodify should reject the empty $set operator. The message for update is '$set' is empty. You must specify a field like so: {$mod: {<field>: ...}}.

promise from insertMany() never resolves

When targetting mongodb-fs, the following client is stuck at the call to col.insertMany():

const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');

(async function() {
  // Connection URL
  const url = "mongodb://localhost:27027";
  // Database Name
  const dbName = 'test';
  const client = new MongoClient(url);

  try {
    // Use connect method to connect to the Server
    await client.connect();
    console.log('Connected correctly to server');

    const db = client.db(dbName);
    console.log('Connected correctly to db', dbName);

    // Get the collection
    const col = db.collection('dates');
    console.log('got col');

    // Insert multiple documents
    const r = await col.insertMany([{ date: new Date() }]);
    console.log('inserted many');

    // Get first two documents that match the query
    const docs = await col.find({}).toArray();
    console.log({ docs });
  } catch (err) {
    console.log(err.stack);
  }

  client.close();
})();

Collection-adding commands must create collection

Any command that adds an element into a collection must create a collection if it doesn't exists. But that should only happen if new element is added. With tests.
The following commands must ensure the collection gets created:

  • insert
  • update with upsert when inserting a new element
  • findAndModify with upsertwhen inserting a new element
  • createIndex

The rest of the commands must not create the collection.

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.