question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

selecting collections doesn't work in a way specified in docs

See original GitHub issue

Subject of the issue

Retrieving collections doesn’t work as described in docs

Your environment

  • version of node: 8.5
  • version of npm: yarn 1.0.2

reproduction here: https://runkit.com/marzelin/x-ray-bug

given this example:

const x = require("x-ray")()
const html = `
<body>
    <ul>
      <li>1-1</li>
      <li>1-2</li>
      <li>1-3</li>
    </ul>
    <ul>
      <li>2-1</li>
      <li>2-2</li>
      <li>2-3</li>
    </ul>
    <ul>
      <li>3-1</li>
      <li>3-2</li>
      <li>3-3</li>
    </ul>
</body>`

x(html, "body", x("ul", ["li"]))((err, result) => {
    console.log(result)
})

per docs x('ul', ['li']) should select all items in the first list but it selects all items in all lists. Also, per docs x(['ul'], ['li']) should return all items in all lists, but it returns nothing.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
marzelincommented, Oct 30, 2017

@JinnaBalu The selector: x('ul', ['li']) should only return items from the first list (["1-1", "1-2", "1-3"]). The result you’ve got is all items from all lists. The selector that should return all items from all lists is x(['ul'], ['li']).

1reaction
willisplummercommented, Nov 15, 2017

I ran into this issue too 😬

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing collections and documents - Pinpoint Help
Open the Documents view in your collection (Documents in the navigation pane); Check the box next to specific documents that you want to...
Read more >
Sharing in Google Docs
Sharing in Google Docs is a great way to work on collaborative documents with anyone you choose. There are a few tricks you...
Read more >
Cloud Firestore Data model - Firebase
Collections and documents are created implicitly in Cloud Firestore. Simply assign data to a document within a collection. If either the collection or...
Read more >
Create collections - Configuration Manager - Microsoft Learn
In the Select Collections dialog box, select the collections you want to exclude from the new collection, and then select OK. Preview collection...
Read more >
Databases and Collections — MongoDB Manual
By default, a collection does not require its documents to have the same schema; i.e. the documents in a single collection do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found