I would like to list fields on course eg title,header when use course-list. does anybody knows about a way to query by fields so the returned list of fields ?
when query on
GET api-2.0/courses/?category=Development&subcategory=Web Development&price=price-free&is_affiliate_agreed=True&instructional_level=all&fields=title,headline
result
result is count all query
Related
I want to get a prospect list from Pardot using its API and only those prospects that have some field's value according to some rules.
For Example :
those prospects which have a website containing 'some string' and year_in_bussines > 3
Your best option here would be to create a dynamic list with your search criteria, then use the API to query prospects on your list with the query argument list_id.
Do keep in mind, dynamic lists are not updated instantly as prospects match/unmatch the criteria, there can be a delay.
I have this structure in index:
{ details: {errors:[], warnings:[], results:[]}}
I want a query so that I can get the count of errors warnings and results for each record.
I was looking into the script filter on an aggregate, but the thing is I am already aggregating and I'm unsure on how to use the value count filter with this since I need to
1) Get the .length attribute of the array
2) When I do that I get an error saying no attribute like that exists
Can I get a sample query? I'm guessing it will somehow incorporate the script filter.
The best way to achieve this is the token count data type told in the below link
LINK - http://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-core-types.html#token_count
You can couple this with multi fields to achieve an extra field per error , warning and results. This can be used in the query to view the count of elements.
I am trying to count the total unique number of heating complaints in the Socrata NYC 311 service requests database: https://data.cityofnewyork.us/Social-Services/All-Heat-complaints-to-311/m5nm-vca4
Ideally I want to use the data to populate a map with unique complaints, as well as the number of complaints by each unique address. So far I have used the following query which only returns about 2 days of data:
http://data.cityofnewyork.us/resource/m5nm-vca4.json?$select=created_date,longitude,latitude,COUNT(*)&$group=created_date,longitude,latitude&$where=complaint_type=%27heating%27
Is there anyway to query the database for unique address across all dates and count them by total complaints?
Can you be a little more descriptive about what you're trying to get? An example of the output you're trying to get would be perfect.
I think we might be able to get what you're looking for, but we need to get the aggregation right.
I want to know the best way of testing data access functionality.
I know that it is possible to create mocks to change data layer objects that is using to test business logic.
However is it possible to test if sql queries to database are correct.
Scenario: A method must return employees which were applied for work last month.
I can return list of object and check if each employee's startDate property is correct (last month).
So if it returns 3 employees and they have correct startDate value but there are more two employee in database which aren't returned. How to write test for that case? :)
Thanks in advance.
You set up the test DB so you shold know what data is in it. If you expect 5 employees to be returned from the query and you get only 3, you know there is an error.
You can test the query with different setups: empty table, only new employees, only old employees, a mix of the two (with special care to the borderline cases), etc.
I don't think you need to check the two other employees in the database which aren't returned.
The key is, when setting up your test data, you would want to ensure you have enough records that don't match the criteria (in addition to the records that do match), then you run the fetch and make sure you get back the correct number of records that do match the criteria.
Preparing the test data in this manner ensures that your method is returning the expected results.
Can anyone help me with this ?
What I am trying to do is retrieve a distinct list of company from the AD using LDAP query.
I wrote a query which returns all the company names, with duplicate values.
What I am trying to achieve is to get a list of distinct companies from AD.
My query for this is as given below.
DistinguishedName used is "ou=Users,o=rackspace"
And I am trying to filter it using the filter
Filter = "(company=*)"
Will you help me to get the list as I need it.
Thanks,
AR
Sorry, but LDAP in its filter definitions does not support a 'distinct' function.
Your filter will only return object who have a company value populated, but it will return duplicates.
You will have to use something else, whether that is something coded, or even a simple Excel spreadsheet to get the distinct values.