Git Product home page Git Product logo

inconsequential's Introduction

inconsequential's People

Contributors

erawat avatar glaforge avatar graemerocher avatar jbrisbin avatar ldaley avatar pledbrook avatar rvanderwerf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

inconsequential's Issues

Extra id field is saved with MongoDB GORM plugin

Using mongodb plugin 1.0M4 from http://grails.org/plugin/mongodb

Grails 1.3.7

Test Domain Class:
package com.test

import org.bson.types.ObjectId

class Person {
static mapWith = "mongo"

ObjectId id
String name

// Address address
// static embedded = ['address']
// static hasMany = [pets: Pet]

static mapping = {
name index: true, indexAttributes: [unique: true, dropDups: true]
//writeConcern WriteConcern.FSYNC_SAFE
// collection "mycollection"
// database "mydb"
// firstName field:"first_name"
}

static constraints = {
}
}

Create a new person and save it, no issue.
Edit the just created person, click update, go to mongodb shell, observe duplicate id fields present for the person instance.
In db:
{ "_id" : ObjectId("4d73a087f3f930d606e3c5b5"), "name" : "my name", "id" : ObjectId("4d73a087f3f930d606e3c5b5") }

Expected:
{ "_id" : ObjectId("4d73a087f3f930d606e3c5b5"), "name" : "my name"}

delete for mongodb plugin

hello,
i think the delete method is returning as normal but no collection is removed in the database.
this integration test is passing nicely but the record is not deleted ?!?
i have version 1.0-M4

void testSimpleDelete() {
def oma = new Product();
oma.title = "omaForDeletion";
oma.save(flush: true);
assertNotNull(oma.id);
def id = oma.id; // debugging shows the appropriate hash
Product.get(id).delete(flush: true);
assertNull "product was not null after deleting ", Product.get(id)
}
with the domain class:

class Product {

String id; // for the hash
String title
static mapWith = "mongo"

}

best regards nils

Clarify difference between MongoDB GORM's embedded and traditional GORM embedded

In traditional (Hibernate based) GORM, if one used an embedded mapping it was also necessary for them to define the embedded class in the same file as the embedding class. With MongoDB, this isn't necessary (indeed, it seems it's required that you don't).

Currently the documentation at http://grails.github.com/inconsequential/mongo/manual/guide/3.%20Mapping%20Domain%20Classes%20to%20Mongo%20Collections.html doesn't clarify this, which can be a bit of a stumbling block for those of us converting from a RDBS-based domain model to Mongo.

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.