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

Refactor doc #116

Merged
merged 9 commits into from
May 5, 2017
Merged

Refactor doc #116

merged 9 commits into from
May 5, 2017

Conversation

jannyHou
Copy link
Contributor

@jannyHou jannyHou commented May 2, 2017

connect to strongloop-internal/scrum-apex#196

  • For easier reading, I would suggest ignore the git compare, just click the updated README.md file.
  • I grap everything from old doc and fit them into new doc.
  • Generate TOC(table of contents)
  • This might not be a perfect document that explains everything in this connector, at this moment I mainly changed the layout so user can quickly search and find the part they are interested in, and pay attention to design their model that fits cloudant nature. Any opinion or suggestions would be helpful :) And specificlly I appreciate reviewers could verify this story by:
    • When you have question on how to use the connector or how it works, the new layout(table of content) can quickly take you to the right place. Or with the keyword you can think of, a quick search on this page can take you to relevant doc.
    • It gives you a better understanding of how a loopback concepts fit cloudant concepts.
    • It explains most questions asked in PMRs or by customers, and includes features TBD so users know what's our refactor direction.

@jannyHou jannyHou force-pushed the refactor/doc branch 5 times, most recently from e617860 to 203c82c Compare May 3, 2017 21:08
@jannyHou jannyHou changed the title Add model doc Refactor doc May 4, 2017
README.md Outdated
@@ -8,16 +8,165 @@ Local.
For more information, see [Getting started with Cloudant NoSQL DB](https://www.ng.bluemix.net/docs/services/Cloudant/index.html)

The `loopback-connector-cloudant` module is the Cloudant connector for the Loopback framework.
<!-- TOC -->

- [loopback-connector-cloudant](#loopback-connector-cloudant)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ssh Sorry I am confused what do we put a PR hyperlink here? This is auto generated by TOC.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean we should not have that there at all. This already points me to the loopback-connector-cloudant. Small thing, if you want to leave as it is I am okay :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ssh24 oh ok I see, true, I have auto TOC generator on when saving my file, not sure how to tell the generator skip it lol. I will disable the generator and delete it in the final commit.

README.md Outdated

<!-- /TOC -->

# Design
Copy link
Member

Choose a reason for hiding this comment

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

It seems to me that they are limitations. If so, it's better to put this section towards the end of the document. When users want to use this connector, they probably want to know about the basic first rather than the limitations. :)

Copy link
Contributor Author

@jannyHou jannyHou May 4, 2017

Choose a reason for hiding this comment

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

@dhmlau True I have to say it's not an exciting thing to mention the "limitation" at the beginning, while it depends on how do you think of the design, IMO, if a user decides to choose cloudant, they may want to be aware of the nature of this database,.
I also feel that my words is not polite enough to describe them as design principles, it gives users a waring impression.
Thinking of how to improve and rephrase it :(

Copy link
Member

Choose a reason for hiding this comment

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

@jannyHou per our discussion, I'm thinking of putting the Design and Model sections under Getting Started. So the structure could be

  • Getting Started
    • Things to consider (the old Design section - we could think of a better name)
    • Best Practices (the old Model section)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhmlau Updated the layout, and also rephrased the titles a little bit in a more friendly way.

README.md Outdated

Workaround: Do not pass partial values for the data object to be updated. If there are properties that are not being updated, please include the old value to keep data persistent.

We plan to support partial update in the future by retrieving the original data and merging it with the updated one, but user should be aware of the risk when merging happens.
Copy link
Member

Choose a reason for hiding this comment

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

not sure if our plan to support is necessary to be included in the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhmlau If eventually we decide to support it, then I feel it's necessary to be included in README. Now the tricky thing is we may not want to do the messy "data merging" in our connector, it's probably better to ask the user provide their own merging solution.
Let's discuss in issue #35
cc @kjdelisle

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's different in open source community. Normally I'd rather not to share the plan in official documentation. If #35 is the one to track the progress, perhaps we could say the discussion related to this topic can be found in #35 (or whatever issue # we use).

Copy link
Contributor Author

@jannyHou jannyHou May 4, 2017

Choose a reason for hiding this comment

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

@dhmlau The git issues column is actually a big features/plan pool :p So I assume it's ok to include plans in doc, anyway community can see them, and might be interested to share more opinions and join the discussion.

I reworded this part to not explicitly describe the plan details.

README.md Outdated
Cloudant is not designed to change same document frequently and multiple times. It stores status change by creating different documents and including the same unique id to tell that they are attached to the same item, not updating the same document.

By modeling the data in separate documents that are only written once, we can ensure that documents never become conflicted, such as during concurrent access to the same document by separate processes.

Copy link
Member

Choose a reason for hiding this comment

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

A generic comment: what's the implication if i do have frequent modification? What's our recommendation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It implicates user need to properly handle doc conflicts by dealing with its revision. I will add that part.

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion:
By modelling the data in separate documents that are only written once, we can reduce the chance of concurrent access to the same document by separate processes.

README.md Outdated

## Map between model and document

Unlike relational db or mongodb, cloudant doesn't have a concept as 'table' or 'collection', data in a cloudant database are all stored as documents.
Copy link
Member

Choose a reason for hiding this comment

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

Minor changes (might occur in the rest of the document too):
cloudant --> Cloudant
loopback --> LoopBack

Copy link
Contributor Author

@jannyHou jannyHou May 4, 2017

Choose a reason for hiding this comment

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

I will update other places as well.

README.md Outdated
@@ -27,7 +176,9 @@ $ npm install loopback-connector-cloudant --save

The `--save` option adds the dependency to the application’s `package.json` file.

## Configuration
# Config
Copy link
Member

Choose a reason for hiding this comment

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

Config --> Configuration

README.md Outdated
## Configuration
# Config

## generate datasource
Copy link
Member

Choose a reason for hiding this comment

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

generate datasource --> Generate DataSource

In general, the title should have the proper capitalization of the first character of the word.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I kept all subtitle lower cases, will change them.

README.md Outdated

TBD.

The basic idea is when modifying a document, user needs to control conflict by handling the revision of a document, currently the connector controls this process, after retriving the latest revision, connector uses it to update/delete doc, and returns 409 conflict error if doc changes during that time slot. In the middle user could not interfere and provide their own conflict solution.
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a comma after In the middle

README.md Outdated

Unlike relational db or mongodb, cloudant doesn't have a concept as 'table' or 'collection', data in a cloudant database are all stored as documents.

The connector uses a design document to represent a loopback model, and other non-design(non-design might not be the best word here, appreciate more ideas about how to describe it) documents to represent model instances.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what you mean by other non-design documents but you just leave it at other documents.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0candy Let me elaborate more on the document type, there are two types of documents in cloudant database:

  • Design document
  • common document that is not a design document

I am not sure what is the brief and accurate word to describe the second one...

README.md Outdated
* Query and filtering is performed on the database for optimal efficiency.
* Use different DB instances per model definition.
* Supports basic model discovery.
For model properties, we plan to create index for property that has config `index: true` in the future, it will be the same way as what mongodb connector does.
Copy link
Contributor

Choose a reason for hiding this comment

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

Start in the future as a new sentence.

README.md Outdated

## _rev property

In a document, property `_rev` is the latest doc revision and must be provided when modifing the doc. Currently when updating/deleting a doc, the connector first retrieves that doc, then gets its `_rev`, then calls a modify api with `_rev` included. It makes three calls to database and this would easily result in race condition.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo modifying
make three calls to the database

README.md Outdated

I believe there are more stuff TBD in this part, appreciate more ideas.
Copy link
Contributor

Choose a reason for hiding this comment

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

Create doesn't require _rev right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch lol

README.md Outdated
ds.updateOrCreate('User', {
prop1: 'updated1',
}, function (err, res) {});
The following migration functions take either an array of multiple models' name, or a string of a single model's name. The example code will show how to do it.
Copy link
Contributor

Choose a reason for hiding this comment

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

model's

README.md Outdated

There is no free version of local Cloudant to download, so to develop or test with Cloudant connector, you must set up either a Cloudant DBaas instance or a Bluemix Cloudant instance.
For development use, a docker container of cloudant local is easy to setup and there is no request limit per second.
Bluemix cloudant will be more stable for product.
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean for production?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0candy I thought they mean the same thing when use "product" as an noun..? I will change it to "production" :)

README.md Outdated

After creating a Cloudant instance, you will need three configuration properties to run the tests: `username`, `password`, `database`
- Cloduant local(docker image)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo Cloudant

@jannyHou
Copy link
Contributor Author

jannyHou commented May 4, 2017

Regarding the first title loopback-connector-cloudant, I have auto TOC generator turning on when saving my file, not sure how to tell the generator skip it lol. I will disable the generator and delete it in the final commit.

@jannyHou jannyHou self-assigned this May 4, 2017
@jannyHou
Copy link
Contributor Author

jannyHou commented May 4, 2017

there are two types of documents in cloudant database:

  • Design document
  • common document that is not a design document

I am not sure what is the brief and accurate word to describe the second one, so ATM I use "common document" to represent it.

@jannyHou
Copy link
Contributor Author

jannyHou commented May 4, 2017

@0candy @dhmlau @ssh24 Comments applied, thanks a lot, PTAL again.

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.

Some small changes.

Also @jannyHou I have noticed in some places the docs are not well written because we do not have the full picture for the upcoming features and their behaviour.

In those places could we leave a more generic message likeTo Be Updated once the bug/feature has been fixed?

README.md Outdated
## Installation
### Careful Frequent Modification

Cloudant is not designed to change same document frequently and multiple times. It stores status change by creating different documents and including the same unique id to tell that they are attached to the same item, not updating the same document.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this to: Cloudant is not designed to change the same document multiple times.

Copy link
Contributor Author

@jannyHou jannyHou May 5, 2017

Choose a reason for hiding this comment

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

I think "frequent" and "multiple" emphasize different things.
"frequent": easy run into race condition, considering simultaneous modifications to same doc
"multiple": considering everytime you need to do a full update(replace), one modification requires large amount of work.

README.md Outdated

By modeling the data in separate documents that are only written once, we can ensure that documents never become conflicted, such as during concurrent access to the same document by separate processes.

While it doesn't mean modification will cause trouble, by properly conflict controllation, developer can still do a safe modify. For details, refer to [Conflict Control](https://github.com/strongloop/loopback-connector-cloudant##conflict-control)
Copy link
Contributor

Choose a reason for hiding this comment

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

by properly conflict controllation

Change to:

by properly controlling the conflict

Copy link
Contributor

Choose a reason for hiding this comment

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

The link for Conflict Control is wrong. Please update to: https://github.com/strongloop/loopback-connector-cloudant#conflict-control

README.md Outdated

### Model-specific configuration

You can also specify per-model configuration for database selection and to
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also specify per-model configuration for database selection

Change to:

You can specify configurations per model for database selection

@jannyHou
Copy link
Contributor Author

jannyHou commented May 5, 2017

@ssh24

In those places could we leave a more generic message likeTo Be Updated once the bug/feature has been fixed?

sounds good to me, I will update those fields once I gather opinions from everyone and PR ready to land.

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.

Please also update places in the readme with a generic To be updated statement in places where the doc will need to be updated with the upcoming refactoring and new feature/bug fixes.

README.md Outdated
## Design
Loopback tries best to fit its model to a specific database's design, while limited by the nature of database, it's not always possible to support all Loopback features perfectly, and user would like to be aware of some key features about Cloudant before they start to design a Cloudant model.

### Careful partial update
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking simply Partial Update is enough?

Copy link
Contributor Author

@jannyHou jannyHou May 5, 2017

Choose a reason for hiding this comment

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

@dhmlau I feel 'careful partial update' would be more clear :p
well tbh it's just a personal feeling and maybe it's good to have feedback from more people @strongloop/sq-lb-apex

Two header options here:

  • option1: 'Careful partial update'
  • option2: 'Partial update'

from a user's perspective, which one would you prefer to see?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for Partial Update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I removed two careful

README.md Outdated

### Careful partial update

*Cloudant does not support the idea of updating a document. All "updates" on a document are _destructive_ replacements.*

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: move the "workaround" to here.

README.md Outdated

*Please note how property `prop2` was completely dropped upon update.*

Workaround: Do not pass partial values for the data object to be updated. If there are properties that are not being updated, please include the old value to keep data persistent.
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could omit the "workaround". If we move this section up, we could say something like...

It implies that unchanged values need to be included in the update object.

Copy link
Contributor Author

@jannyHou jannyHou May 5, 2017

Choose a reason for hiding this comment

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

I move this part up and change it to

It implies that if you do want to partially update a document, please make sure unchanged values are included in the update object.

README.md Outdated

### Careful Frequent Modification

Cloudant is not designed to change same document frequently and multiple times. It stores status change by creating different documents and including the same unique id to tell that they are attached to the same item, not updating the same document.
Copy link
Member

Choose a reason for hiding this comment

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

status change --> status changes?

README.md Outdated
Cloudant is not designed to change same document frequently and multiple times. It stores status change by creating different documents and including the same unique id to tell that they are attached to the same item, not updating the same document.

By modeling the data in separate documents that are only written once, we can ensure that documents never become conflicted, such as during concurrent access to the same document by separate processes.

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion:
By modelling the data in separate documents that are only written once, we can reduce the chance of concurrent access to the same document by separate processes.

README.md Outdated

By modeling the data in separate documents that are only written once, we can ensure that documents never become conflicted, such as during concurrent access to the same document by separate processes.

While it doesn't mean modification will cause trouble, by properly controlling the conflict, developer can still do a safe modify. For details, refer to [Conflict Control](https://github.com/strongloop/loopback-connector-cloudant#conflict-control)
Copy link
Member

Choose a reason for hiding this comment

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

maybe we don't need While it doesn't mean modification will cause trouble? :)

@jannyHou
Copy link
Contributor Author

jannyHou commented May 5, 2017

Suggestion:
By modelling the data in separate documents that are only written once, we can reduce the chance of concurrent access to the same document by separate processes.

@dhmlau I copied that part from couchdb document lol, but yours looks better. Changed.

README.md Outdated
@@ -8,16 +8,207 @@ Local.
For more information, see [Getting started with Cloudant NoSQL DB](https://www.ng.bluemix.net/docs/services/Cloudant/index.html)

The `loopback-connector-cloudant` module is the Cloudant connector for the Loopback framework.
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick LoopBack

README.md Outdated

We have some discussion on update methods, the issue link can be found in [Feature Backlog](https://github.com/strongloop/loopback-connector-cloudant##feature-backlog) section

### Careful Frequent Modification
Copy link
Contributor

Choose a reason for hiding this comment

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

I think having just Frequent Modification here is enough, but am okay with this as well.

|---------------|------------------------------|---------------------------------------|------------------------|
| Relational DB | table | column in table | row in table |
| Mongodb | collection | createIndex if property.index is true | document in collection |
| Cloudant | Design documents in database | NOT stored in document | common documents in database |
Copy link
Contributor

Choose a reason for hiding this comment

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

If you know where model property is stored for cloudant, can you put that information here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, sorry I don't quite understand "If you know where model property is stored for cloudant", for example, where is it stored? could you give me a concrete example?

| | Model | Model Property | Model Instance |
|---------------|------------------------------|---------------------------------------|------------------------|
| Relational DB | table | column in table | row in table |
| Mongodb | collection | createIndex if property.index is true | document in collection |
Copy link
Contributor

Choose a reason for hiding this comment

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

what if property.index is false for mongodb?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't confirm with a real mongodb db collection, just read the logic from code: https://github.com/strongloop/loopback-connector-mongodb/blob/master/lib/mongodb.js#L1381

if index === false, connector does nothing to the property.

README.md Outdated
* Query and filtering is performed on the database for optimal efficiency.
* Use different DB instances per model definition.
* Supports basic model discovery.
For model properties, we plan to create index for property that has config `index: true`. In the future, it will be the same way as what mongodb connector does.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add a statement to say what happens when index: false or not specified?

README.md Outdated
- No request limit.
- Please follow https://hub.docker.com/r/ibmcom/cloudant-developer/ to create your Cloudant local instance

- Setup Cloudant on Bluemix
Copy link
Contributor

Choose a reason for hiding this comment

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

Cloudant on Bluemix to keep it consistent

- Limited free trial.
- Sign up with https://cloudant.com/sign-up/ then you will see your Cloudant dashboard.

To view the Cloudant dashboard on both DBaaS and Bluemix, [sign in](https://cloudant.com/sign-in/) with your Cloudant username and password.
Copy link
Contributor

Choose a reason for hiding this comment

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

are we sure that the link will log you in to your instances in Bluemix? thought you had to log into Bluemix for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember I can login with bluemix account, IIRC after you login bluemix and go to the cloudant instance dashboard, it just directs you to same domain as DBaaS

README.md Outdated
return User.destroyAll();
}).then(function(user) {
console.log('destroy user!');
})catch(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

}).catch(err);

README.md Outdated

```
Loopback api assumes user include the `_rev` when modifying data, so please make sure you handle document's revision properly before you call a POST/PATCH/DELETE api. For details, refer to https://github.com/strongloop/loopback-connector-cloudant#_rev-property
Copy link
Contributor

@b-admike b-admike May 5, 2017

Choose a reason for hiding this comment

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

nitpick LoopBack API

README.md Outdated

#### Note on using `updateOrCreate` functionality:
**Cloudant does not support the idea of updating a document. All "updates" on a document are _destructive_ replacements.**
I believe there are more stuff TBD in this part, appreciate more ideas.
Copy link
Contributor

Choose a reason for hiding this comment

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

@jannyHou
Copy link
Contributor Author

jannyHou commented May 5, 2017

@b-admike @dhmlau @0candy PTAL again. Thanks.

README.md Outdated
# Getting Started

## Design
LoopBack tries best to fit its model to a specific database's design, while limited by the nature of database, it's not always possible to support all LoopBack features perfectly, and user would like to be aware of some key features about Cloudant before they start to design a Cloudant model.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be users should be aware of some key features

README.md Outdated

# Setup Cloudant Instance

For user that don't have a cloudant server to develop or test, here is some suggestions can help you quickly setup one.
Copy link
Contributor

@0candy 0candy May 5, 2017

Choose a reason for hiding this comment

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

here are some suggestions that can help you


For example, in function `Cloudant.prototype.destroy`, we call driver function by [`mo.db.destroy`](https://github.com/strongloop/loopback-connector-cloudant/blob/a62f72f291ed6fd7a5c318ceea3220cf19a2f2fe/lib/cloudant.js#L612), `mo` is the model.

I am going to add some code example & test case to demo/verify this feature. That's why I keep it in a separate doc page.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove this line before check in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0candy this is on purpose, I pick the url of code from a specific commit, so the line number wouldn't change when master keeps getting new PR checked in.


For example, in function `Cloudant.prototype.destroy`, we call driver function by [`mo.db.destroy`](https://github.com/strongloop/loopback-connector-cloudant/blob/a62f72f291ed6fd7a5c318ceea3220cf19a2f2fe/lib/cloudant.js#L612), `mo` is the model.

I am going to add some code example & test case to demo/verify this feature. That's why I keep it in a separate doc page.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed "That's why I keep it in a separate doc page.", that is not public facing word.

@jannyHou jannyHou merged commit ca262d3 into master May 5, 2017
@jannyHou jannyHou deleted the refactor/doc branch May 15, 2017 14:34
kjdelisle pushed a commit that referenced this pull request Aug 22, 2017
 * Inherit couchdb functionalities (#163) (Sakib Hasan)
 * Add stalebot configuration (Kevin Delisle)
 * Recover & reuse couchdb2 tests (jannyHou)
 * Fix readme (ssh24)
 * Create Issue and PR Templates (#171) (Sakib Hasan)
 * Add CODEOWNER file (Diana Lau)
 * Recover manipulation.test.js (#159) (Janny)
 * Recover juggler tests (#158) (Janny)
 * Require init on mocha args (ssh24)
 * Do not strip _rev value on create (ssh24)
 * Fix docs on bulk replace op hooks (ssh24)
 * Fix update/updateAll function (ssh24)
 * Add cloudant specific bulkReplace function (ssh24)
 * Check error and result (#149) (Janny)
 * Fix updateAttributes function (ssh24)
 * Fix doc (#148) (Janny)
 * viewDocs (#133) (Janny)
 * Return back result count in updateAll (ssh24)
 * Fix database name typo on README (ssh24)
 * Add regexp doc (#143) (Janny)
 * Add proxy config test (#142) (Janny)
 * Allow users to spawn docker and run tests (ssh24)
 * test: use Cloudant 2.x based image for testing (Ryan Graham)
 * test: replace setup.sh with test.js (Ryan Graham)
 * Refactor functions in cloudant (ssh24)
 * Allow handling of ._rev on models (#123) (Kevin Delisle)
 * Allow travis to run against the latest code base (#138) (Sakib Hasan)
 * Add docker setup (#132) (Sakib Hasan)
 * Fix updateOrCreate (#136) (Sakib Hasan)
 * Fix typo (#135) (Janny)
 * cloudant.test: cleanup after test runs (Kevin Delisle)
 * Setup Travis with Docker Compose (Kevin Delisle)
 * Refactor doc (#116) (Janny)
 * reinstate bulk update (biniam)
 * add array prop update tests (biniam)
 * update docs with current revision (biniam)
 * Allow id property to be a number (#115) (Sakib Hasan)
 * autoupdate and automigrate fix (#109) (Janny)
 * update readme to doc async connect (biniam)
 * check cloudant db in config (biniam)
 * call driver asynchronously (biniam)
 * Fix sort query builder (#107) (Janny)
 * Recover maxrows.test.js (#91) (Janny)
 * Fix regexp.test.js (#103) (Janny)
 * Use define function in loopback-connector (jannyHou)
 * add url config example (biniam)
 * Update connector to 4.0.0 (ssh24)
 * Add doc for fitler and order (jannyHou)
 * Add advisory note regarding update (ssh24)
 * Add $elemMatch for array (jannyHou)
 * Revert "Build selector with array type data" (jannyHou)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants