Code Monkey home page Code Monkey logo

Comments (4)

scottburch avatar scottburch commented on May 22, 2024

._id has been a problem with groundDB so far. See #27

I work around it by including _id in the object passed to Collection.insert() using collection2 and including an autovalue for _id using Random.id()

from ground-db.

IstoraMandiri avatar IstoraMandiri commented on May 22, 2024

Thanks @scottburch, that workaround did the trick for me.

For others, to make it work with CFS, you need to upload a FS.File. Do the following:

Template.test.events
  'change input' : (e) ->
    file = new FS.File e.currentTarget.files[0]
    file._id = Random.id()
    uploadedFile = col.insert file
    console.log 'uploaded', uploadedFile._id # zt7JbYQjWwKNqtFEu

from ground-db.

raix avatar raix commented on May 22, 2024

Thanks guys!
Strange - I'd like to get to the bottom of this issue - ground:db is using a normal Meteor.collection - I can see that _id is missing from the method call it self though in the qa test - I'll have a closer look at this.

from ground-db.

raix avatar raix commented on May 22, 2024

This is still an odd issue, I'm trying to track down the true issue... Its not consistent, and the workaround should not be necessary..

I can replicate the issue in my qa test clients - but if I open the console and do db.insert({ foo: 'test' }, function(err, id) { console.log(id); }); it returns an id...

Also I can replicate this issue using a regular Meteor.Collection... In fact at the moment grounddb is using plain Meteor.Collection for this - So somethings weird is going on...

What I can see is that the Meteor.Collection.insert is not adding an _id in the data sent to Meteor.apply.

from ground-db.

Related Issues (20)

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.