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

create sequence for nosql id #1354

Merged
merged 4 commits into from
May 2, 2017
Merged

create sequence for nosql id #1354

merged 4 commits into from
May 2, 2017

Conversation

jannyHou
Copy link
Contributor

@jannyHou jannyHou commented Apr 25, 2017

Description

PR created when recovering test cases in cloudant:
cloudant creates string type id which could not guarantee id are incremented. To solve the problem, I add a sequence property to make sure the related test case returns result ordered by sequence and will skip the first data.

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

Copy link
Contributor

@ssh24 ssh24 left a comment

Choose a reason for hiding this comment

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

LGTM

@jannyHou jannyHou force-pushed the fix/relation-test branch 4 times, most recently from 29e47ba to 80acca7 Compare April 27, 2017 01:09
users[0].name.should.equal('John Lennon');
users[1].name.should.equal('Paul McCartney');
var expectedNames = ['John Lennon', 'Paul McCartney'];
expectedNames.indexOf(users[0].name).should.be.above(-1);
Copy link
Member

Choose a reason for hiding this comment

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

I guess we're checking the index is not -1... would it be should.not.equal(-1)?

// mongodb returns `id` as an object
idArr[0] = idArr[0].toString();
idArr[1] = idArr[1].toString();
idArr.indexOf(ch[0].id.toString()).should.be.above(-1);
Copy link
Member

Choose a reason for hiding this comment

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

same comment.. if we're checking index should not be -1, perhaps better to use should.not.equal(-1).

@jannyHou
Copy link
Contributor Author

@dhmlau thanks applied.

@jannyHou jannyHou force-pushed the fix/relation-test branch 2 times, most recently from b0ab6e3 to c1e2095 Compare April 28, 2017 19:49
@jannyHou jannyHou force-pushed the fix/relation-test branch from c1e2095 to 23f1856 Compare May 2, 2017 16:36
@jannyHou jannyHou merged commit 5d10c72 into master May 2, 2017
@jannyHou jannyHou removed the #review label May 2, 2017
kjdelisle pushed a commit that referenced this pull request May 2, 2017
 * create sequence for nosql id (#1354) (Janny)
 * Fix order of query results (Loay)
 * Add DateString type (Kevin Delisle)
 * datatype.test: use predefined date (Kevin Delisle)
 * Update api documents (Loay)
 * Datasource documentation tune-up (Kevin Delisle)
 * Added unit tests specific to DateType where null (#1349) (Andrew McDonnell)
 * Fix/geo null (#1334) (paulussup)
 * replace exception thrown for invalid dates (Diana Lau)
 * Revert PR #1326 (#1336) (Sakib Hasan)
 * Make lib peerDepend on loopback-connector (#1326) (Russ Tyndall)
 * Add test case using updateAttributes (Loay)
 * Fix forceId bug for updateOrCreate (Loay)
 * Fix typo in description (jannyHou)
 * Fix relations test case (loay)
@jannyHou jannyHou deleted the fix/relation-test branch May 26, 2017 15:20
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.

4 participants