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

fix(mongo): let replace create new documents #15

Merged
merged 1 commit into from
Nov 19, 2014

Conversation

petrjasek
Copy link
Member

so that we can do upsert

@petrjasek
Copy link
Member Author

@superdesk/developers

@ioanpocol
Copy link

👍

@@ -428,7 +428,7 @@ def replace(self, resource, id_, document):
# have changed since the ETag was computed. This would require getting
# the original document as an argument though.
try:
self.driver.db[datasource].update(filter_, document,
self.driver.db[datasource].update(filter_, document, upsert=True,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this actually hide a race condition?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you put the document doesn't have to be there imo, does it?

amagdas added a commit that referenced this pull request Nov 19, 2014
fix(mongo): let replace create new documents
@amagdas amagdas merged commit 4bff372 into superdesk:develop Nov 19, 2014
amagdas added a commit to amagdas/eve that referenced this pull request Dec 9, 2014
fix(mongo): let replace create new documents
amagdas added a commit to amagdas/eve that referenced this pull request Jan 13, 2015
commit 646ad57
Author: Kuna Siva <[email protected]>
Date:   Tue Dec 9 12:12:41 2014 +1100

    Versioning Ignores source of datasource

    Versioning always treats resource name as the datasource but for some resources the actual datasource is defined in resource_def['datasource']['source']

commit 811b2be
Author: Mayur Dhamanwala <[email protected]>
Date:   Fri Dec 5 15:17:04 2014 +1100

    fixing the bug where objectid is None then it does not serialize it.

commit 4bff372
Merge: 1ddaa00 7798860
Author: Magdas Adrian <[email protected]>
Date:   Wed Nov 19 10:37:19 2014 +0200

    Merge pull request superdesk#15 from petrjasek/develop

    fix(mongo): let replace create new documents

commit 7798860
Author: petr.jasek <[email protected]>
Date:   Fri Nov 14 14:01:27 2014 +1100

    fix(mongo): let replace create new documents

    so that we can do upsert

commit 1ddaa00
Merge: 2db0a04 dfd54d4
Author: petr.jasek <[email protected]>
Date:   Thu Sep 25 19:31:39 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 2db0a04
Merge: 5fcdc6d 732081a
Author: Magdas Adrian <[email protected]>
Date:   Tue Sep 2 10:02:17 2014 +0200

    Merge pull request superdesk#14 from amagdas/disable-cache

    Disable cache

commit 5fcdc6d
Merge: 5338208 40093f8
Author: Magdas Adrian <[email protected]>
Date:   Fri Aug 29 14:08:35 2014 +0300

    Merge pull request superdesk#13 from superdesk/fix-weak-date

    use rfc1123 date format for weak_date

commit 5338208
Merge: 852a436 2a10775
Author: Magdas Adrian <[email protected]>
Date:   Thu Aug 28 11:33:20 2014 +0300

    Merge pull request superdesk#12 from amagdas/sync-upstream

    Sync upstream

commit 2a10775
Merge: 242439e 89ae133
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request superdesk#11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 89ae133
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.

commit 852a436
Merge: 2b0d11e 26679c6
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request superdesk#11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 26679c6
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.
amagdas added a commit that referenced this pull request Feb 24, 2015
commit 646ad57
Author: Kuna Siva <[email protected]>
Date:   Tue Dec 9 12:12:41 2014 +1100

    Versioning Ignores source of datasource

    Versioning always treats resource name as the datasource but for some resources the actual datasource is defined in resource_def['datasource']['source']

commit 811b2be
Author: Mayur Dhamanwala <[email protected]>
Date:   Fri Dec 5 15:17:04 2014 +1100

    fixing the bug where objectid is None then it does not serialize it.

commit 4bff372
Merge: 1ddaa00 7798860
Author: Magdas Adrian <[email protected]>
Date:   Wed Nov 19 10:37:19 2014 +0200

    Merge pull request #15 from petrjasek/develop

    fix(mongo): let replace create new documents

commit 7798860
Author: petr.jasek <[email protected]>
Date:   Fri Nov 14 14:01:27 2014 +1100

    fix(mongo): let replace create new documents

    so that we can do upsert

commit 1ddaa00
Merge: 2db0a04 dfd54d4
Author: petr.jasek <[email protected]>
Date:   Thu Sep 25 19:31:39 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 2db0a04
Merge: 5fcdc6d 732081a
Author: Magdas Adrian <[email protected]>
Date:   Tue Sep 2 10:02:17 2014 +0200

    Merge pull request #14 from amagdas/disable-cache

    Disable cache

commit 5fcdc6d
Merge: 5338208 40093f8
Author: Magdas Adrian <[email protected]>
Date:   Fri Aug 29 14:08:35 2014 +0300

    Merge pull request #13 from superdesk/fix-weak-date

    use rfc1123 date format for weak_date

commit 5338208
Merge: 852a436 2a10775
Author: Magdas Adrian <[email protected]>
Date:   Thu Aug 28 11:33:20 2014 +0300

    Merge pull request #12 from amagdas/sync-upstream

    Sync upstream

commit 2a10775
Merge: 242439e 89ae133
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request #11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 89ae133
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.

commit 852a436
Merge: 2b0d11e 26679c6
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request #11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 26679c6
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.
amagdas added a commit that referenced this pull request Mar 1, 2015
commit 646ad57
Author: Kuna Siva <[email protected]>
Date:   Tue Dec 9 12:12:41 2014 +1100

    Versioning Ignores source of datasource

    Versioning always treats resource name as the datasource but for some resources the actual datasource is defined in resource_def['datasource']['source']

commit 811b2be
Author: Mayur Dhamanwala <[email protected]>
Date:   Fri Dec 5 15:17:04 2014 +1100

    fixing the bug where objectid is None then it does not serialize it.

commit 4bff372
Merge: 1ddaa00 7798860
Author: Magdas Adrian <[email protected]>
Date:   Wed Nov 19 10:37:19 2014 +0200

    Merge pull request #15 from petrjasek/develop

    fix(mongo): let replace create new documents

commit 7798860
Author: petr.jasek <[email protected]>
Date:   Fri Nov 14 14:01:27 2014 +1100

    fix(mongo): let replace create new documents

    so that we can do upsert

commit 1ddaa00
Merge: 2db0a04 dfd54d4
Author: petr.jasek <[email protected]>
Date:   Thu Sep 25 19:31:39 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 2db0a04
Merge: 5fcdc6d 732081a
Author: Magdas Adrian <[email protected]>
Date:   Tue Sep 2 10:02:17 2014 +0200

    Merge pull request #14 from amagdas/disable-cache

    Disable cache

commit 5fcdc6d
Merge: 5338208 40093f8
Author: Magdas Adrian <[email protected]>
Date:   Fri Aug 29 14:08:35 2014 +0300

    Merge pull request #13 from superdesk/fix-weak-date

    use rfc1123 date format for weak_date

commit 5338208
Merge: 852a436 2a10775
Author: Magdas Adrian <[email protected]>
Date:   Thu Aug 28 11:33:20 2014 +0300

    Merge pull request #12 from amagdas/sync-upstream

    Sync upstream

commit 2a10775
Merge: 242439e 89ae133
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request #11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 89ae133
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.

commit 852a436
Merge: 2b0d11e 26679c6
Author: Petr Jašek <[email protected]>
Date:   Fri Aug 22 09:23:06 2014 +0200

    Merge pull request #11 from ioanpocol/develop

    Add support for custom HATEOAS

commit 26679c6
Author: ioanpocol <[email protected]>
Date:   Fri Aug 22 10:19:33 2014 +0300

    Add support for custom HATEOAS

    Updated the code in order to don't overwrite '_self' and 'self' if already exists in doc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants