Skip to content

Update JS Docs #497

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

Merged
merged 3 commits into from
Jan 18, 2018
Merged

Update JS Docs #497

merged 3 commits into from
Jan 18, 2018

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jan 16, 2018

Closes: parse-community/Parse-SDK-JS#543

  • Polygon
  • Schema API
  • Aggregate and Distinct
  • Full Text

I'm not the best at explaining so any help would be great.

Also If there are any new JS features I missed I can add them here.

I'll use this as a base for iOS and Android Guides

Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

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

Various changes, questions, clarifications and such. There's probably some other stuff that will need to be caught in a second review once this initial items are addressed.

### Full Text Search

Use `fullText` for efficient search capabilities. Text indexes are automatically created for you. Your strings are turned into tokens for fast searching.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would put the note regarding the 'cost' of full text search ops up here instead. That way it's a disclaimer of sorts as to what kind of impact this may have, before they start seeing any examples.


For Case or Diacritic Sensitive search, please use the [REST API](http://docs.parseplatform.org/rest/guide/#queries-on-string-values).

* Note: Full Text Search can be expensive operations.
Copy link
Contributor

Choose a reason for hiding this comment

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

*this would be the note to move up ^, and maybe with some further clarification as to 'expensive operations'.

};

// Pipeline array
const pipeline = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Should either rename to 'pipelineArray' or change from const to var or let. In the same example you have two constants declared with the same name, and although it's just an example it should probably show correct code 😉 .


For a list of available operators please refer to [Mongo Aggregate Documentation](https://docs.mongodb.com/v3.2/reference/operator/aggregation/).

* Note: Most operation in Mongo Aggregate Documentation will work with Parse-Server, but `_id` doesn't exist. Please replace with `objectId`.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo:

Most operations in...

});
</code></pre>

<pre><code class="javascript">
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add some descriptive text before this code block to detail what's in it, especially since it's only preceded by another block.

This API allows you to access the schemas of your app.

* `MasterKey` is required.
* Starting with Parse-Server 2.7.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Parse-Server thing

@@ -9,7 +9,7 @@ types in the databrowser.
This API allows you to access the schemas of your app.
Note: This API can be only accessed using the `master key`.

* Starting with Parse-Server 3.0 Index support added.
* Starting with Parse-Server 2.7.1 Index support added.
Copy link
Contributor

Choose a reason for hiding this comment

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

Parse-Server thing


Schema will return an object similar to the following:

<pre><code class="javascript">
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait a minute...this is a duplicate file of schema.md right? Is there a particular reason why this one (or that one) is being added?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops


// Animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback);
().end().animate({ opacity: to }, speed, easing, callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

Reason for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

No Idea, I think when I ran bundle install this happened or maybe my text-editor linter.

I'll change it back

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine then, so as it's functional.

@@ -22,6 +22,7 @@ sections:
- "js/analytics.md"
- "common/data.md"
- "common/relations.md"
- "js/schema.md"
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're just adding schema.md you might want to drop schemas.md. In the php section I have it setup to reference schema.md already, might as well be consistent.

@dplewis
Copy link
Member Author

dplewis commented Jan 18, 2018

@montymxb Thanks for the initial review. I went ahead and added some more aggregate examples.

@dplewis
Copy link
Member Author

dplewis commented Jan 18, 2018

@flovilmart Can you look over this?

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

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

I agree with @montymxb comments, otherwise LGTM

@@ -9,7 +9,7 @@ types in the databrowser.
This API allows you to access the schemas of your app.
Note: This API can be only accessed using the `master key`.

* Starting with Parse-Server 3.0 Index support added.
* Starting with Parse Server 2.7.1 Index support added.
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't even realize the 3.0 thing there...nice catch

Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

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

Alright second look over and it's pretty good! Just some nits here and there.

To note I'm not 100% sure I want to move those locations for server requirements, as I see they're already following the leading paragraph in other sections of the docs. To retract what I put down before, I would use that existing style instead, that and the blue note is fine (and don't worry about the italics). I'll update those comments shortly to reflect this.

@@ -57,6 +57,38 @@ query.find({
});
</code></pre>

You can query for whether an object lies within / on a polygon of `Parse.GeoPoint` (minimum 3 points):
Copy link
Contributor

Choose a reason for hiding this comment

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

can probably replace the / with 'or' just to be a bit more explicit.

});
</code></pre>

You can query for whether an object `Parse.Polygon` contains a `Parse.GeoPoint`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Stylistic

You can also query for whether...

@@ -205,6 +205,39 @@ The above example will match any `BarbecueSauce` objects where the value in the

Queries that have regular expression constraints are very expensive, especially for classes with over 100,000 records. Parse restricts how many such operations can be run on a particular app at any given time.

### Full Text Search

Use `fullText` for efficient search capabilities. Text indexes are automatically created for you. Your strings are turned into tokens for fast searching.
Copy link
Contributor

Choose a reason for hiding this comment

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

Stylistic

You can use fullText for efficient...


Use `fullText` for efficient search capabilities. Text indexes are automatically created for you. Your strings are turned into tokens for fast searching.

* Note: Full Text Search can be resource expensive. As with all indexes ensure you have enough RAM. Speed comes at a cost.
Copy link
Contributor

Choose a reason for hiding this comment

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

Stylistic


* Note: Full Text Search can be resource expensive. As with all indexes ensure you have enough RAM. Speed comes at a cost.

Requires Parse Server 2.5.0+
Copy link
Contributor

@montymxb montymxb Jan 18, 2018

Choose a reason for hiding this comment

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

I was wondering about these requirement labels, we should try to standardize them so they're not just dotted around. I think a solution could be to make sure this immediately follows the feature title. In this case ### Full Text Search. Also, and this is just a thought, but maybe we should italicize this entire requirement, just to emphasize it before the reader attempts to start implementing said feature.

Make sure to lead the requirement with * immediately following the introductory paragraph of the feature.


Queries can be made using aggregates, allowing you to retrieve objects over a set of input values. The results will not be `Parse.Object`s since you will be aggregating your own fields

* Note: MasterKey is Required. Parse Server 2.7.1+
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here, we should move this statement directly below the title of Aggregate. Should make sure it's similar to the others as well. We can keep the master key requirement in there though, makes sense to have that as well.

Copy link
Contributor

@montymxb montymxb Jan 18, 2018

Choose a reason for hiding this comment

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

Also I'm not set in stone on this one. Using an * marks it with a blue + on the docs, and that might be good as is, but location should be standardized below the title.

Positioning is good here, but you could break up the masterKey & server requirement, with the server one first.


Queries can be made using distinct, allowing you find unique values for a specified field.

* Note: MasterKey is required. Parse Server 2.7.1+
Copy link
Contributor

@montymxb montymxb Jan 18, 2018

Choose a reason for hiding this comment

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

same here
Could break it up.

This API allows you to access the schemas of your app.

* `MasterKey` is required.
* Starting with Parse Server 2.7.1
Copy link
Contributor

@montymxb montymxb Jan 18, 2018

Choose a reason for hiding this comment

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

same here.
Positioning is pretty good here, and the parts are broken up. This how the others should be done as well. Could also stand to flip the order so the server requirement is prioritized before the master key.

@montymxb
Copy link
Contributor

Just amended some of those comments in the review.

@dplewis
Copy link
Member Author

dplewis commented Jan 18, 2018

Thanks again, changes made

Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

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

Looks approved :octocat:

@montymxb montymxb merged commit 3181215 into parse-community:gh-pages Jan 18, 2018
@montymxb
Copy link
Contributor

Thanks again for putting up the PR @dplewis . Guess we'll be seeing a couple for iOS and Android pretty soon too!

@dplewis dplewis deleted the aggregate branch January 19, 2018 14:47
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.

Documentation for Aggregate Queries
4 participants