Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update removes positional operator $ in key when used on DBRef property [DATAMONGO-1077] #1997

Closed
spring-projects-issues opened this issue Oct 27, 2014 · 2 comments
Assignees
Labels
in: mapping Mapping and conversion infrastructure type: bug A general bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Oct 27, 2014

Christoph Strobl opened DATAMONGO-1077 and commented

Ensure the following works in UpdateMapperUnitTests.

/**
 * @see SO-26556527
 */
@Test
public void shouldNotRemovePositionalParameter() {

	Update update = new Update();
	update.unset("dbRefAnnotatedList.$");

	DBObject mappedUpdate = mapper.getMappedObject(update.getUpdateObject(),
			context.getPersistentEntity(DocumentWithDBRefCollection.class));

	DBObject $unset = DBObjectTestUtils.getAsDBObject(mappedUpdate, "$unset");

	assertThat($unset, equalTo(new BasicDBObjectBuilder().add("dbRefAnnotatedList.$", 1).get()));
}

Affects: 1.5.4 (Dijkstra SR4), 1.6 GA (Evans)

Reference URL: http://stackoverflow.com/questions/26556527/spring-data-mongodb-removes-a-positional-operator-from-unset-update-query-par

Referenced from: pull request #235

Backported to: 1.6.1 (Evans SR1)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 28, 2014

Thomas Darimont commented

This is now fixed in master and 1.6.x.

Backporting this to 1.5.x is a bit more involved since some infrastructure is missing (AssociationConverter etc.)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 30, 2014

Thomas Darimont commented

Please revise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mapping Mapping and conversion infrastructure type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants